-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
syncState preventing File upload? #266
Comments
@dwijesingheWR doing |
@qwales1 Thanks for getting back to me. I tried setting |
@dwijesingheWR is the database getting updated at all? |
Yes I have another syncState call watching a different state property (data) and all changes to data, which is a fairly simple object, persist to Firebase without issue. In addition if I change
to
the |
@dwijesingheWR oh yeah now i see that sorry. I'm not sure about storing files in firebase directly. base64 encoding them looks like it works from a quick search but I know they have Firebase Storage now for files |
Hi,
My React app allows the user to select one or more images, renders a preview of the selected images, then allows them to submit the image up to the server. Until they are sent to the server, images are store in the App state as an associative array
{files: []}
. The code was working until I started using Firebase to persist the App state and added asyncState
call forfiles
. After adding the syncState call myaddFile
function can no longer update the App statefiles
array. I tested, and simply removing the syncState code for files restores full functionality to the app. Am I doing something wrong in terms of how I'm using syncState here? I have another syncState call on separate App data and it works without issue.This is the code from my FileSelector component:
And the code for addFile (coded in a parent component and passed via props)
Finally my componentDidMount method which has the syncState code
The text was updated successfully, but these errors were encountered: