Conversation
- `redux-form` is not maintained anymore - With this commit, only the new dependency is added. No migration took place so far. We'll have to migrate one form after the other. Once all forms have been migrated, the `redux-form` dependency can be removed. - Also needed to be able to upgrade `redux` to the latest version v5 (`redux-form` is not compatible with redux v5)
Without this, the default type of the buttons is `submit` which can cause weird behaviors if enter is hit somewhere in the form (in this case the browser looks for the first submit button in the form and if it was a clear button, the field was being cleared - which of course didn't make sense)
- There was a bug where the field didn't consider new values if the value prop changed and the outdated values was displayed (noticed when movment wizard was migrated from redux-form to react-final-form) - We could fix this in the component, but we can as well remove the local state, as it only makes everything unnecessarily complicated
- We're keeping the wizard values in `state.ui.wizard.values` now - Everything should work just like before for the user
All forms have been migrated to `react-final-form` and the unmaintained `redux-form` dependency is not needed anymore.
- Functional component with destructured props instead of a class - useSelector replaces mapStateToProps — reads directly from the Redux store - useDispatch replaces mapDispatchToProps — you no longer need connect() at all - useEffect with [] replaces componentWillMount — runs once after first render. (componentWillMount actually ran before render, but for data fetching the difference is negligible and useEffect is the correct modern pattern) - PropTypes for injected Redux props are removed since they're no longer passed from a parent — only the truly external props remain
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.