4 ms·
Not really, React doesn't do "one thing [well]", it's responsible for: - UI rendering - State management - Component lifecycle - Event handling - Data flow
by iLemming 2y ago
Not really, React doesn't do "one thing [well]", it's responsible for:
- UI rendering
- State management
- Component lifecycle
- Event handling
- Data flow
- JSX templating
In that sense React truly is a comprehensive UI framework, not a single-purpose library.
Counter-examples of "do one thing well" are Lodash and Axios.
- dmkolobov 2y agoI’d say all of those bullets fall under the umbrella of “rendering” in an asynchronous execution environment like browsers, where code often depends on a consistent and predictable view of the DOM. I’m willing to hear arguments about the merits of how React approaches these issues, but I would want any frontend UI library for generating and updating DOM trees to address them in some way.
- ambicapter 2y agolodash is a utility library (so chock-full of functionality) how can you say it "does one thing well"?
- grodriguez100 2y agoHe actually says it is a counter-example of “does one thing well”.
- ambicapter 2y agoOops, misread that.
- Izkata 2y agoState management is typically handled by other libraries. React can do it, but it's not great for a full app. Maybe "data flow" too, not really sure what makes that different from "state management".
- darepublic 2y agoLodash does a hundred different things and then people start using it in place of super simple code or native capabilities ballooning the third party API you need to learn
- qudat 2y agoDisagree. State management is an anti feature in react and you don’t need JSX to use react. It’s only true feature is the view = func(state), everything else should be outsourced to something else.
- molszanski 2y agoYup. Don't use react for state or some hook spaghetti like react query. Use mobx and live happily ever after :)
- qudat 2y agoExactly. Although I would go with starfx instead
- molszanski 2y agoDidn't know about starfx. Interesting. To anyone reading, mobx is a more generic tool for any type of state management. And starfx seems like a data fetching + holding state and providing hooks for that data kind of library. Very unique and looks someone cared to make something nice for that kind of problem
- neoconomist 2y agostarfx looks interesting and innovative ! thanks for sharing