0% found this document useful (0 votes)
26 views7 pages

State Management in React Js

Zhzjzh

Uploaded by

suraj satav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views7 pages

State Management in React Js

Zhzjzh

Uploaded by

suraj satav
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

State

Management
in React Js
There are basically 2 types of state in
any React application

1. Server Cache
2. UI State
Server Cache

➡️ It's the data that comes from the


server ( through API calls )

➡️ We need to act upon that data


and store it locally / globally in our
React application
Server Cache ( Example )

➡️ React Query
➡️ Apollo Client ( For GraphQL )
➡️ RTK Query ( For Redux )
UI / Client State

➡️ The client state describes the


user actions such as toggle navbar,
open / close modal, change theme
preference, etc.
It's also used to hold values for
component specific task. Example -
"counter"
UI State ( Example )

➡️ useState, useEffect,
useRef Hooks (For smaller projects)

➡️ Context API + Basic Hooks


( For medium projects)
Do you find this post
helpful then please do
share this post with your
connections ;))

You might also like