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
loadUser() should run first via Suspense in App.tsx.
clientLoader() in home.tsx should wait for loadUser() to complete before checking permissions.
🛑 Actual Behavior
clientLoader() runs before loadUser() finishes.
Even when trying to include loadUser() in clientLoader, it does not wait for the layout’s clientLoader.
❓ Question
How can I ensure that loadUser() runs first before executing clientLoader()?
Would love any suggestions or best practices on handling this issue in React Router v7. 🚀
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
Uh oh!
There was an error while loading. Please reload this page.
-
🚀 Issue: React Router v7 -
clientLoader()
Runs BeforeloadUser()
❓ Problem
I recently migrated my project to React Router v7 following the official upgrade guide:
🔗 React Router v7 Upgrade Guide.
Here are my main components:
root.tsx
app.tsx
home.tsx
🔍 Expected Behavior
🛑 Actual Behavior
❓ Question
How can I ensure that loadUser() runs first before executing clientLoader()?
Would love any suggestions or best practices on handling this issue in React Router v7. 🚀
Tags:
React Router
,Suspense
,Middleware
,Authentication
,React
Beta Was this translation helpful? Give feedback.
All reactions