Q: How I could pass user data from back to frontend? I made a YelpCamp clone ony with node and EJS but I'm trying to convert to a Node-React project and was working until I try to list a specific user... To get the SHOW route of a User I need to get the route "/users/:id", also I need to react to know which user is logged in to check if he is a admin or not to show an edit and delete buttons. However, the React don't know which id to send to the request...
How could I set this id on the client side? I'm using passport-local and passport-jwt to handle login/register. I know that I can use this token for something like this, but I'm not sure how I can do this!
I don't wanna make this post dirty, so I'll link to my files on github:
1 - Auth.ts
2 - UserModel.ts
3 - UserController
4 - Routes.ts
5 - Register.tsx
6 - Login.tsx
7 - User.tsx

A: I didn't know about useContext and Context API, so the answer is: search about useContext hook and how do you create a Context on React without Redux!
Initial link: useContext
