Live data from Hacker News

Things I wish I knew about state management when I started writing React apps

medium.com

1–10 of 335 posts

Re: Things I wish I knew about state management when I started writing React apps

#4
post #3

I’ve been learning React and have been avoiding Redux out of fear of complexity. However, as my app grows more complex, the need for a global state manager becomes more apparent. Time to start learning Redux today :)

Or mobx :)

Re: Things I wish I knew about state management when I started writing React apps

#6
post #3

I’ve been learning React and have been avoiding Redux out of fear of complexity. However, as my app grows more complex, the need for a global state manager becomes more apparent. Time to start learning Redux today :)

Try zustand!

Re: Things I wish I knew about state management when I started writing React apps

#7
post #3

I’ve been learning React and have been avoiding Redux out of fear of complexity. However, as my app grows more complex, the need for a global state manager becomes more apparent. Time to start learning Redux today :)

It's not the amount of complexity that leads to needing Redux, it's the type of complexity. You can go a long way on keeping state in the nearest common ancestor of the components that need to share it.

https://redux.js.org/faq/general/#when-should-i-use-redux

Re: Things I wish I knew about state management when I started writing React apps

#8
What's the deal with the recommendation to use some library for managing forms? I've been working with React almost since its initial release and I've built some pretty complex forms... yet form libraries remain the one thing I've never really seen a need for.

At the very least, using something like formik shouldn't be a necessity. There should be some qualifier that it's only really needed for very complex forms. Or am I missing something?

Re: Things I wish I knew about state management when I started writing React apps

#10
post #3

I’ve been learning React and have been avoiding Redux out of fear of complexity. However, as my app grows more complex, the need for a global state manager becomes more apparent. Time to start learning Redux today :)

I never understood why redux was considered "hard" - it basically keeps track of a plain javascript object that you can read/write across a react app
Post reply on HN