Reactjs State Management

Hello,

My name is Trevor and I’m very new to frontend development and have been trying to work with reactjs in typescript. Been following the redux guide very closely and trying to understand how createApi and createSlice work together within a component. So far the example is working however, the first request sent when the component is loaded in will result in a 500 error from my server and the second request works just fine.

The component in question is the Profile.jsx page under src/features/users/Profile.jsx. When the user is authenticated the server returns an access token and that token is persisted into the redux store. But on the first request sent by the component loading the auth token is not provided. Any guidance is appreciated on this issue.

Github: GitHub - structx/react-chat