I
I
IDigle12020-12-11 00:04:55
React
IDigle1, 2020-12-11 00:04:55

Is there an analogue of vue observers in react?

I need to write to the local storage every time the state changes, tell me how you can track the state change, or how else to solve this problem in a simple way, without resorting to duplicating the "setState({..})" code in 100 code points, where , directly, the same state change is made, I'm new to React, thanks in advance)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2020-12-11
@0xD34F

useEffect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question