Fetching resources only when logged in
Here for example I want to fetch all those resources only when logged() === true
right now it fetches every time someone navigates to that page and that results in the page freezing (clicking links/navigating doesnt work)
how is this supposed to be handled?
1 Reply
Same here
this was my attempt at route data function but it doesnt work as intended because initially logged is === to null, the AuthContext makes an api call to check if user is logged or not and then its set to true or false but the data function doesnt rerun