Element - Route definitions seem to be using same instance of element #9611
Unanswered
kevinfairclough
asked this question in
Q&A
Replies: 2 comments 1 reply
-
This is just how React renders. If you provide it the same tree of elements between renders, it will re-use those instances. The |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi thanks for the reply. So in the route definition above are there 2 instances of MyScreen or 1 ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I have routes configured like so:
When i navigate(...) from inside MyScreen from an Edit route to a New route it seems to re-use the same instance of element MyScreen. React or the Router doesn't create a new element. Is there a prop on the route def to do this, I cant seem to find any docs for this.
I can add a key="new" on the element to force this but can't do this when I need to navigate to different id's and I want new Screens each time.
TIA
Kevin
Beta Was this translation helpful? Give feedback.
All reactions