-
Notifications
You must be signed in to change notification settings - Fork 43
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
Warnings when using with React-Router #49
Comments
The issue is that |
@markerikson
The router didn't work without I did understand that Components which need router variables need to be wrapped with |
@Rakk4403 : Yeah, that seems more reasonable. To recap a bit: you only need to use |
@markerikson Thanks for your answer. ProblemInvestigating the problem, there was such a situation:
It works well except being with |
@markerikson This problem with react router is because you are using React.PureComponent. Read https://reacttraining.com/react-router/web/guides/dealing-with-update-blocking. My next question is why you are using a PureComponent when the component is stateless? You should not need to use a component at all. The job of the layout is not to optimise the rerendering of something. |
Hi, I am facing exactly the same PureComponent issue. I would like to do that: <BrowserRouter>
<Box>
<Nav
docs={this.state.docs}
/>
<Routes/>
</Box>
</BrowserRouter> But the Routes component never gets updated by url change. Is there a reason to use that PureComponent instead of a simple stateless component ? This issue is blocking be for using your library that looks nice ... |
Feel free to send a PR that goes back to using simple components instead. I also honestly believe we don't need them to be pure here. Could be done on user-side by wrapping the component if required. |
Hello, I'm a freshman in React.
I got this message, but I cannot help avoiding this:
My app is working even with this warnings, but I don't wanna clean up console msgs.
This is my use case:
I tried to removing props of Router(match, location, history, staticContext) by this function, but It breaks successful works.
I just want to remove warning message in console, is there a way for this?
There is no answers in SO.
Should I keep going with warnings?
The text was updated successfully, but these errors were encountered: