Answer the question
In order to leave comments, you need to log in
How to dynamically load a react module into an application?
Friends, tell me how you can dynamically load react components while the site is running.
For example, we have a menu, and while clicking on one of the sections, load the js file with the react component and include it in the application.
This is necessary in order not to load extra js with components until it is required.
Answer the question
In order to leave comments, you need to log in
If webpack is used to build the application, then you can simply use the require.ensure, System.import constructs. Pack itself processes them and cuts the code into separate chunks. You can see how you can separate individual routes here https://github.com/davezuko/react-redux-starter-ki...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question