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
Issue: Root layout(sidebar) doesn't update or re-render after action and redirection.
React router: v6.10
Hi all, I am following the tutorial which requires to build a contact list and having some problems now. For now my app is able to show the updated contact details with actions and redirection, except the root layout, which should be the sidebar and didn't update unless I refreshed the whole page.
The dev tools shows that my root layout was not re-rendering after I click save/delete button, meanwhile the contact UI re-rendered and updated. I am not sure if that's because the redirect() inside those child routes only makes the children re-render instead of both parent and children. How should I do to make the root layout update at the same time when any contact updated?
BTW I am using useEffect to load data rather than useLoadData() since it's hard for me to use in TS.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Issue: Root layout(sidebar) doesn't update or re-render after action and redirection.
React router: v6.10
Hi all, I am following the tutorial which requires to build a contact list and having some problems now. For now my app is able to show the updated contact details with actions and redirection, except the root layout, which should be the sidebar and didn't update unless I refreshed the whole page.
The dev tools shows that my root layout was not re-rendering after I click save/delete button, meanwhile the contact UI re-rendered and updated. I am not sure if that's because the redirect() inside those child routes only makes the children re-render instead of both parent and children. How should I do to make the root layout update at the same time when any contact updated?
BTW I am using useEffect to load data rather than useLoadData() since it's hard for me to use in TS.
Thanks so much!
Beta Was this translation helpful? Give feedback.
All reactions