T
TanStack10mo ago
frail-apricot

Context not updating

I'm trying to use Route.useRouteContext hook to get fetched data (user, todos, etc.) but the data is not updated. If is a refreshed page (like F5, target _blank, etc.) the data is the default value (fallback). If you change the current page (using navigate or Link component) the value is loaded normally. Reproduction: https://stackblitz.com/edit/vitejs-vite-qzfl5f?file=src%2Froutes%2Findex.lazy.tsx
No description
No description
1 Reply
unwilling-turquoise
unwilling-turquoise10mo ago
looks like you put a react context into router? that's most likely not working as expected

Did you find this page helpful?