Anh Khoa Ngô do you have a link to your code? I will take a look at it and see if I can help. Ultimately you only want your store connected to the components you want to know what is happening with the store.
If you are using redux I normally have things setup as follows:
I don't think the idea you gave me would solve my problem.
I know I should make routes as a function, but this is server side rendering. Because of that, server.js have function called match(), which take routes as the first parameter as an object, not a function.
I don't know I have pinned the problem right or understand it completely. Please help me!
Cody Brunner
Learning more everyday!
Anh Khoa Ngô do you have a link to your code? I will take a look at it and see if I can help. Ultimately you only want your store connected to the components you want to know what is happening with the store.
If you are using
reduxI normally have things setup as follows:// index.js import React from 'react'; import { render } from 'react-dom'; import Root from './Root'; render(<Root />, document.getElementById('root'); // Root.js import React from 'react'; import { Provider } from 'react-redux'; import store from './redux/store'; import Routes from './Routes'; export default () => ( <Provider store={store}> <Routes /> </Provider> ); // Routes.js import React from 'react'; import { browserHistory, Route, Router } from 'react-router'; export default () => ( <Router history={browserHistory}> // your Routes here </Router> );