form upload.md
const filesPath was the default static value on the code top
i need filesPath can be changed so in my code filelsPath was setted by redux from
but in the recompose code style , that have a problem
like:
export const ImageUpload = compose(
// Create listeners for Real Time Database which write to redux store
firebaseConnect([{ path: filesPath }]),
connect(state => {
const path = selector(state, 'name')
return {
uploadedFiles: state.firebase.data[filesPath],
filesPath: path
}
}),e
setPropTypes(enhancerPropsTypes), // Set proptypes of props used within handlers
withHandlers(handlers)
)(Component)
because filesPath was in the component firebaseConnect can`t be get it
so i just want to quest have any way to get value for firebaseConnect ?
You can provide a function that returns an array as the first argument instead of an array as shown in the query docs and the state based query snippet example.
// Pass filesPath prop as query path
firebaseConnect((props) => [{ path: props.filesPath }]),
Make sure you get the uploadedFiles object from the correct location of state afterwards.
Most helpful comment
You can provide a function that returns an array as the first argument instead of an array as shown in the query docs and the state based query snippet example.
Make sure you get the
uploadedFilesobject from the correct location of state afterwards.