Relative Content

Tag Archive for reactjsreact-hooksreact-reduxreact-router

RequireAuthN Component Redirects to /signin Before accessToken Updates

I’m working on a React application where I need to ensure that users are authenticated before they can access certain routes. I have a RequireAuthN component that is supposed to redirect unauthenticated users to the /signin page. However, it seems to redirect to /signin even when the accessToken is being updated asynchronously.

I am not able to get the desired output

I am not getting the desired output. I am trying to code a small task.The task is that I want to change the color of the screen background, the text and the button as shown in the uploaded image.There are total 3 files of the code. The index one, the one that contains the custom hook and the css file. I am uploading all of them. The commands change in the local storage upon pressing of “change theme” button but the changes don’t reflect on screen. I am attaching the code. Please answer if you now what’s the problem: