Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nav-bar consistency error. #413

Closed
MrJoy opened this issue Aug 1, 2017 · 14 comments
Closed

Nav-bar consistency error. #413

MrJoy opened this issue Aug 1, 2017 · 14 comments

Comments

@MrJoy
Copy link

MrJoy commented Aug 1, 2017

When going to https://www.reactrails.com/ and clicking Test React Router ('/react-router'), the navigation bar entry for React Router Demo remains selected. When loading https://www.reactrails.com/react-router directly, it is not.

I'm not sure which behavior is the intended one, but the inconsistency suggests a bug.

@justin808
Copy link
Member

@MrJoy I agree. Can you take a look and let me know what you find?

@justin808
Copy link
Member

If anybody sees this issue, it's a great way to try adding a contribution to this project.

@justin808
Copy link
Member

@bluemihai did you want to submit a PR?

@ramrudra
Copy link

ramrudra commented Aug 26, 2018

@justin808 What is the intended behaviour here?

Current:
Test React Router ('/react-router'), the navigation bar entry for React Router Demo remains selected.

Is this the intended behaviour?
React Router Demo menu item should be active when visiting '/react-router'

@justin808
Copy link
Member

@ramrudra

  • when you click the link for the home page (/) and then go to click the link for Test React Router ('/react-router'), you see the highlight of react-router stays
  • but not if you go to the second directly, say from a bookmark

@ramrudra
Copy link

@justin808 That's correct. Is that the intended behaviour? if not what is the intended behaviour?

@iamfaizanahmad
Copy link
Contributor

@justin808 I am working on this one.

iamfaizanahmad pushed a commit to iamfaizanahmad/react-webpack-rails-tutorial that referenced this issue Oct 15, 2018
justin808 pushed a commit that referenced this issue Oct 23, 2018
* #413 nav-bar consistency fixed

* cli build fail issue resolved
@mdiaz00147
Copy link

@justin808 I'd like to try on this one. May I? I'm applying for upwork position as well thx

@tahsin352
Copy link

@justin808 in react router 4, first, need to import withRouter like: import {withRouter} from 'react-router-dom'; then we can get the current path this.props.location.pathname

we can match it and then add 'active' class to respective menu item. thx.

@justin808
Copy link
Member

Please link to a PR if you want to suggest some fix.

I'm more eager to get the webpack configuration updated and make a sensible configuration for hot reloading.

@Sirbuland
Copy link

@justin808
Looks like it is working fine.

screenshot 2019-02-22 at 7 10 30 pm

@tahsin352
Copy link

Please link to a PR if you want to suggest some fix.

I'm more eager to get the webpack configuration updated and make a sensible configuration for hot reloading.

@justin808 sorry, i might be wrong, but it i guess it is problem with routing, it has nothing with hot-reloading, coz, hot-reloading is a solution to display any update made to any component on the page. but here we are fixing the routing issue. we can use NavLink from react-dom-router. you can see this example for reference : https://codeburst.io/getting-started-with-react-router-5c978f70df91 . it can be done with webpack also. thx.

dreamsoftech added a commit to dreamsoftech/react-webpack-rails-tutorial that referenced this issue Apr 23, 2019
In react dev tool, there are duplicated providers.
Seems like url changes does not represent redux connected component
render.
This fixed shakacode#413 issue but got an another error.
@dreamsoftech
Copy link

@justin808 When I debug to fix this issue, I found some interesting thing. There are duplicated providers.
image
To fix this issue, I tried to remove NavigationBarApp in clientRegistration.jsx.
It fixed this issue but replicates console error. Since I am not familiar with this code, I need to discuss something with you.

@ahangarha
Copy link
Contributor

This issue is already resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants