GitHub:fay-react-redux-loadable
npm:@fay-react/react-redux-loadable
Act and redux are dynamically loaded for react components, Reducer and sagas. Code-spliting is simple to write and easy to use in formal projects
I wrote some examples about code-spliting a long time ago. With the development of the technical library, this time I cleaned up the code-spliting used in a project and integrated redux. The current react version under the time node is 16.9.0. React loadable has been used in the past, but it has not been maintained for a long time, mainly because React already has a lazy API and webpackimport(/* webpackChunkName: "test" */'./views')
The problem of code-spliting has been solved in a good way. Given the way of code-splitting in the official documents of Webpack and Redux, I integrated a copy by myself. The one I wrote a long time ago was a code-spliting solution for the Act&Redux project when there were no third-party libraries.
The code is on GitHub, see the address below the title. It is very simple to use and does not need to integrate REdux. Meanwhile, it also provides parameters of Redux middleware, which is convenient to add middleware like React-router, and also provides parameters to initialize reducer. Add a reducer similar to the react-router that needs to be initialized
This library is only a small integration, easy to use in the project, does not contain original technology, if you like to suggest copying the past into your own project, I hope to like this integration way, have good suggestions welcome to share, common progress