-
Notifications
You must be signed in to change notification settings - Fork 216
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
Use props.file in FileUpload #180
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
As far as I can see (in FileUpload.js)
propTypes: {
buttonLabelChange: React.PropTypes.string,
buttonLabelInitial: React.PropTypes.string,
disabled: React.PropTypes.bool,
file: React.PropTypes.object,
onChange: React.PropTypes.func
}
file can be sent in as props.
but in render there is no connection to this props but only to the file set in the components state.
So e.g. if user uses the FileDragAndDrop there is no way to inject the dropped file into the FileUpload component.
By changing in the render function to prioritize the props.file value, if set, this works nicely
var file = this.props.file || _state.file;
Don't know if this breaks anything else but I post it here if it here and hopefully it helps this great project and perhaps could be included in a future release
BR
Stefan
The text was updated successfully, but these errors were encountered: