the murmurous sea

React state vs. Redux state 본문

#dev/개념정리

React state vs. Redux state

lunacer 2021. 5. 26. 14:35

https://spin.atomicobject.com/2017/06/07/react-state-vs-redux-state/

 

React State vs. Redux State: When and Why?

Even if you choose to use Redux in your project, you will still need to make decisions on how much of your data is stored in Redux.

spin.atomicobject.com

"Redux manages state and state transformations and is often used with React, but React has its own concept of state."
"Even if you choose to use Redux in your project, you will still need to make decisions on how much of your data is stored in Redux."

 

React Redux
stored locally within a component. state is stored globally in the Redux store.
Short-term state:
Data that will likely change rapidly
(eg. form input data, filter a list of items, show/hide items)
Medium-term state:
Data that will stick around while the user navigates.
Data loaded from an API, or any changes that you want to be persisted up until a page refreshes.
(eg. submitting a form, updating profile info)

Long-term state:

This is state that should be persisted between refreshes of the page or between separate visits to the page. 
Since the Redux store will be created anew when refreshing,
this type of data should be stored somewhere else(A database on a server or local storage in the browser).

 

https://medium.com/@dan_abramov/you-might-not-need-redux-be46360cf367

 

You Might Not Need Redux

People often choose Redux before they need it. “What if our app doesn’t scale without it?” Later, developers frown at the indirection Redux…

medium.com

 

'#dev > 개념정리' 카테고리의 다른 글

How to kill a port  (0) 2021.04.16
app.get() vs. router.get()  (0) 2021.04.15
UX/UI: Branding  (0) 2021.01.26
UX/UI: what makes good web design  (0) 2021.01.23
UI: Responsive layout grid  (0) 2020.10.28
Comments