react
react copied to clipboard
[BUG] React-formio: getForm Action is not working when try to fetch form details by alias.
Environment
Please provide as many details as you can:
- react-formio: ^4.0.0-rc.11
- Formio.js version: ^4.0.0-rc.21
Steps to Reproduce
Try to fetch form details by form alias or name.
Expected behavior
Fetch a form from the server. If no id is provided, the name is used as the path
Observed behavior
TypeError: Cannot read property '1' of null
Example
React Reducer sample code
event: combineReducers({
form: form({ name: 'event'}),
submission: submission({name: 'event'}),
submissions: submissions({name: 'event'}),
})
const mapDispatchToProps = (dispatch, ownProps) => {
return {
getForm: () => dispatch(getForm('event')),
onSubmit: (submission) => {
dispatch(saveSubmission('event', submission, null, (err, submission) => {
if (!err) {
dispatch(resetSubmissions('event'));
dispatch(push(`/event`))
}
}));
}
}
}
I think issue is because of missing a forward slash in Ternary Operation on line 81 in Action.js file of form module.
