I am using reacr-router-redux for this appilication.
Application Flow: I have two pages in my application: Login Page and App Page. Landing page should be Login Page and when I click on Login button then it should take me to the App Page. There are three sections in App Page: Header, Sidebar and Content Section. Content section is dynamic and renders two different layouts depending on which link is clicked in sidebar. Only one component at a time can be rendered in content section.
Problem: I have defined routes. I get landed to LoginPage correctly. When I click to Login, I get navigated to app page also correctly. But when I click a link on sidebar, all the components (sidebar, header and content section) disappears.
My code
main index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import registerServiceWorker from './registerServiceWorker';
import Root from './Container/Root'
import {Provider} from 'react-redux'
import {ConnectedRouter} from 'react-router-redux'
import store, {history} from './store'
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<div>
<Root />
</div>
</ConnectedRouter>
</Provider>,
document.getElementById('root'));
registerServiceWorker();
What is wrong in what I am doing? In previous versions of router it was pretty simple to define child routes and everything. I am new to this router v4.
This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux where there are a lot more people ready to help you out. Thanks!
I am trying to setup react router in my react application. The versions I am using are
I am using reacr-router-redux for this appilication.
Application Flow: I have two pages in my application: Login Page and App Page. Landing page should be Login Page and when I click on Login button then it should take me to the App Page. There are three sections in App Page: Header, Sidebar and Content Section. Content section is dynamic and renders two different layouts depending on which link is clicked in sidebar. Only one component at a time can be rendered in content section.
Problem: I have defined routes. I get landed to LoginPage correctly. When I click to Login, I get navigated to app page also correctly. But when I click a link on sidebar, all the components (sidebar, header and content section) disappears.
My code
main index.js
Root/index.js
App.js (here's where the problem is)
MenuPanel/index.js (This is the sidebar I change the content component from)
What is wrong in what I am doing? In previous versions of router it was pretty simple to define child routes and everything. I am new to this router v4.