czar  pfp
czar
@czar
Which state management solution do you use in React? What do you recommend to someone who started learning React only recently?
1 reply
0 recast
0 reaction

Max Jackson pfp
Max Jackson
@mxjxn.eth
@tanstack/react-query is the safest. https://tanstack.com/query/latest/docs/react/overview def learn built-ins like context, useReducer etc. but it gets messy once you start introducing useEffects left & right. At my last job, I suggested we drop react-context for this library 👇 and it saved us a TON of headache.
1 reply
0 recast
0 reaction

Max Jackson pfp
Max Jackson
@mxjxn.eth
the other answer is Redux. A little bit of a learning curve and not too much different from using react-context, but its widely used and great functional reactive basis for an app
1 reply
0 recast
0 reaction

czar  pfp
czar
@czar
Thanks Max. I was looking at redux. Then the same material also talks about react context. Was wondering which one to use. I didn’t see much difference in both, in the material they covered. Slightly leaning towards redux now.
1 reply
0 recast
0 reaction

Max Jackson pfp
Max Jackson
@mxjxn.eth
Good, I'd say redux is a better staring point because it's a more clearly prescribed way of doing things. Although I've never used it 😂 cljs/re-frame taught me functional reactive app state management
1 reply
0 recast
1 reaction