You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometime I was sawing the well known warning, browser.js:49 Warning: [react-router] You cannot change <Router routes>; it will be ignored and I found two trend issues that friends discussed about this issue and the solution is const routes components and putting them inside Router component.
This is OK, awesome solution to vanish [react-router] warning, and for Root Component changing state the routes was static and you won't see any warnings. BUT my issue is: I pass Root Component props to each Route and I can not do the above solution 😞 ,
I must put App Route inside Router so with this method absolutely this is not solution method and I will saw the known warning again, see my router code:
I passed this as a props to AppRoutes component and I need to pass inherited this.props to sub Routes and use them. how I could won't see warning and pass props to any Routes?
One of my solution is that, I write all Routes as static and call Root Componentprops directly inside each component, but how? I don't know how I can call and keep props of Root Component inside the component that need to have props of Root Component as the component is not direct Root Component children?
The text was updated successfully, but these errors were encountered:
@frenzzy , Thanks dear friend for your answer, dudes in React Router answer me like a BOSS: here and Stack Overflow answer was not related to my question. A Dear friend just wanna help me and write a method that it didn't work. so I write my answer here to someone help me.
Sometime I was sawing the well known warning,
browser.js:49 Warning: [react-router] You cannot change <Router routes>; it will be ignored
and I found two trend issues that friends discussed about this issue and the solution isconst
routes components and putting them insideRouter
component.remix-run/react-router#2704
reactjs/react-router-redux#179
Just like below:
you will see warning with this code:
but you won't see warning with this code:
This is OK, awesome solution to vanish [react-router] warning, and for
Root Component
changingstate
theroutes
was static and you won't see any warnings. BUT my issue is: I passRoot Component
props to eachRoute
and I can not do the above solution 😞 ,I must put App
Route
inside Router so with this method absolutely this is not solution method and I will saw the known warning again, see my router code:And the
Root Component
render code is:I passed this as a props to
AppRoutes
component and I need to pass inheritedthis.props
to subRoute
s and use them. how I could won't see warning and pass props to anyRoute
s?One of my solution is that, I write all
Route
s as static and callRoot Component
props
directly inside each component, but how? I don't know how I can call and keepprops
ofRoot Component
inside the component that need to haveprops
ofRoot Component
as the component is not directRoot Component
children?The text was updated successfully, but these errors were encountered: