Guest User

Untitled

a guest
Nov 21st, 2018
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. private handleAddFiles = (files: any) => {
  2. const filesData = files.forEach(({ name, size, type, uuid }) => ({ name, size, type, uuid }));
  3.  
  4. files.forEach(file => {
  5. const uuid = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/g.exec(file.preview)[0];
  6. file['uuid'] = uuid;
  7. });
  8.  
  9. this.setState({
  10. files: this.state.files.concat(files),
  11. filesData: this.state.files.concat(filesData)
  12. })
  13. console.log(this.state.filesData); //undefined
  14. }
Add Comment
Please, Sign In to add comment