Refer to the release notes to get more details on these changes
Need to replace old middleware() syntax with @namespace; see documentation
Migration process can be automatised: disable use-namespace rule, enable no-middleware and then npm run eslint:fix. Check for correctness, enable the first rule back and enjoy the new awesome syntax!
Be careful, the automated process is not always correct:
- If mapStateToProps was wrapped in middleware in the declaration, it will be replaced by
undefined
, and the namespace decorator will be added in an unpredictable location in the file. This is because the conventional way of wrapping mapStateToProps is when using it toconnect
, not in the declaration.