Replies: 1 comment 3 replies
-
please provide a minimal complete example by forking one of the existing examples on stackblitz |
Beta Was this translation helpful? Give feedback.
3 replies
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.
-
I have a file structure like this:
now first my app will be authenticated by login. in login i will get the user details and set the user in authContext. then when i will go to /addClient or /addProject i need the user details again because of I need to know the user type. So in autheticated.tsx i have a beforeload function which set user by fetching it. so the updated user is added in context. then when I go to the /addClient or /addProject I check the user type in beforeLoad function which is inside _projectManager.tsx. but here inside the context of beforeLoad it says undefined for the value of user. why? how to solve this?
Code:
So my question is why context.auth is null in _projectManager.tsx ? I just update the context value. but I don't get the updated value. It shows null. How to solve this?
And one more error is showing. Because of context.auth is null so
is throwing error though user type is project manager.


And last thing is in the _authenticated.tsx console.log(auth) is showing the updated user value that I fetch from server. but not in the context.
Beta Was this translation helpful? Give feedback.
All reactions