---
title: React Front End Questions
author: Jonah Faas
published: 1/30/2026
description: Homework on react
---
# React Front-End WorkSheet
The following questions are based on the User Manager React front-end project.

### Question 1
Explain how the JWT access token is sent when making API calls.
```md
Its sent in the auth header 
```

### Question 2
Explain how the JWT access token is persisted on the client, so that it is not deleted
when the page is refreshed.
```md
its put in the local or session storage database
```

### Question 3
Explain the UserContext component. Be sure to mention the following:
- What is it's purpose?
- Explain what the code in the component does.
- Explain how to make use of the component in other parts of the app
```md
it helps manage user related data and it lets you pass it down without having to prop drill, you reference the data by creating a custom hook and then referencing the hook later on
```

### Question 4
Explain the **useEffect** hook in react, including:
- Describe a few scenarios in which you would use it
- Explain the how the **dependencies array** works
```md
useeffect is used to perform side effects like data fetching or dom manipulation, the dependencies array is used to determine when the effect is rendered
```

### Question 5
Explain the **useState** hook, including:
- What does it do? What is it for?
- When would you use it for a variable?
- When would you NOT use it for a variable?
```md
usestate is used to add a state variable and store it across page re-renders you use it for interactive data and when a change needs to be shown on screen, you don't use it if you don't need to re-render the component or for static values
```