Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Context is also relatively new, and capturing errors I believe was only possible with class components, or it changed recently.

Redux, mobx, etc also were all options to fix the basic state management in React.

I concede it is not every week. I should have said the preferred approach changes too often for my taste.



I believe context predate hooks. You are right about error boundaries, probably should be revisited.

This might be controversial but imo the lack of state management in React is a pro not a con. It means the community can innovate instead of being stuck with whatever the framework provides as is standard with most other frameworks. A lean focussed but flexible API.

You can choose the flavor that works for your, patterns like React Query, SWR, Zustand, the Atom based stuff, it's all a big #win imo. I like having options.

Also I'd say changes in preferences are not exclusive to React. React did make the hook change (while still supporting the old!), but otherwise the preferred approaches are not per se exclusive to React.

I would add that there is nothing wrong with sticking to what you are using atm. You don't have to use the shiny new thing if the old works well!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: