Closed kopeclu2 closed 3 years ago
I think that this is not good idead how to do it.
ref.current.setState({ images: [...items, i] })
Hi @kopeclu2 , If what you want to do is just save the ready image, you can use this.
ref.current.setState({
images: [
...ref.current.state.images,
ref.current.create({
done: true,
name: "Item 1",
size: "232kb",
source:
"https://images.unsplash.com/photo-1549880338-65ddcdfd017b?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=4050&q=80"
})
]
});
If you want to upload the file, you can send a File type array to the uploadFiles
method.
await ref.current.uploadFiles([file]);
Hi @m-inan, thank you for the solution. It's great workaround! However the issue still needs to be fixed.
Thanks :)
Hello, i have issue. I need for you to implement rerender RUG state, after initialState change. I need to add images from outside to RUG. Thank you for reply :)