How to know if a state has changed from another component using useEffect
Details of my question are provided below:
https://stackoverflow.com/questions/77903315/how-to-know-if-the-state-in-react-query-has-changed-from-another-component-using
Note that it's not the same case of mine, but it's something very relative.
Stack Overflow
How to know if the state in React Query has changed from another co...
Suppose I have 4 files in React JS, which are: 1 external file, 2 pages and 1 component:
Login.js (1 page)
counter.cache.js (1 file)
Landing.js(1 page)
Counter.js (1 component)
1- In Login.js, I ...
2 Replies
unwilling-turquoise•2y ago
Sounds like an xy problem
You probably don’t want to mix query with useState and useEffect
equal-aquaOP•2y ago
Mainly, I'm using in my project useMutation, socket-io and more...
So, to make it easy, I have provided it in this way. So, once I'm increasing counter sate , Landing Page and counter component must re-render together and not ONLY counter component.
That's the main problem.