I am very new to react world. I was gone through many examples of react, flux, webpack etc. I found that when I create a page as a react component it is bundled by webpack and loaded in the page.
How to load react components dynamically when I click each tab. I have done this using reat-router, but the problem is in the index.js I have to include all the tab components.
var Tab1 = require('./components/Tab1');
var Tab2 = require('./components/Tab2');
var Tab3 = require('./components/Tab3');
render((
<Router>
<Route path="/" component={Tab1}>
<Route path="about" component={Tab2} />
<Route path="users" component={Tab3} />
</Route>
</Router>
), document.body)
is there any way to load these components dynamically without including the components early in the page? or webpack will handle this? When i search the bundle.js I found all the components there. In my case each components will be a heavy scripts, so it is not good to load all the components in the first loading itself.