Hacker News new | ask | show | jobs
by LELISOSKA 3618 days ago
here is some advice: don't use redux or any sort of state library, just use a normal state object, it only clutters your code.
2 comments

I think this is great advice for a beginner on their first project. Using React's localState for everything is a huge anti-pattern, but Redux adds cognitive overhead and boilerplate.

Later, when you do a real project, Redux makes debugging and state consistency about 10 times easier, especially on a team or coordinating between multiple teams.

I find a mix is good. I went without a flux implementation for a while and eventually ran into issues with figuring out what components to implement business logic and typical action reducer type work.

I'd say really good advice I wish I had known was don't start with a flux implementation. Build out your app with standard react state, use state only at last cost (ie derive logic off of props or whatever else via functions before storing state data), and only when you get into a bit of mess with a really large application and too much difficulty deciphering what components are providing logic and how they interact with each other should you implement a flux.

Also, it's worth watching Dan Abramov's learning redux course on egghead just for how it gets you to think about react, javascript, and GUI development in general.