reactjs / react-router-redux

Ruthlessly simple bindings to keep react-router and redux in sync
https://www.npmjs.com/package/react-router-redux
MIT License
7.81k stars 644 forks source link

routes not working properly #626

Closed The-Code-Monkey closed 6 years ago

The-Code-Monkey commented 6 years ago

what im trying to do is change a link based on the page, so when the user is logged out it will always say login if they are logged in but not on the dashboard it will say dashboard and when they are on the dashboard it will say log out but the problem is that when you go onto the dashboard page it doesnt change,

{props.logged ? window.location.pathname.split('/')[1] === 'dashboard' ? <a className='nav-link' tabIndex='1' onClick={() => { props.logout(); }}>Log Out</a> : <Link to='/dashboard' className='nav-link'>Dashboard</Link> : <a onClick={() => props.login('uname', 'pword')} tabIndex='1' className='nav-link'>Login</a> }

why does this not work?

timdorr commented 6 years ago

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!