4 ms·
I wouldn’t call React a framework personally. To me it’s a library like moment.js or ramda.
by thrashh 5y ago
I wouldn’t call React a framework personally. To me it’s a library like moment.js or ramda.
- tashoecraft 5y agoI’d call it both. There’s the use case of adding small react components sprinkled through an application, in this case it’s a library. Then there’s the use case of having everything be a react component, and you use lots of react specific libraries, and a react router, react form handler, etc etc. that’s react the framework.
- have_faith 5y agoReact is a sort-of-library that exposes an API to plug in the missing pieces to produce a framework. OP of the article would probably actually like it. Want to write your own routing or state management? by all means go ahead.
- simonw 5y agoI know the React team like to claim that it's a library, not a framework, but I don't buy that at all. My definition of a framework is code which defines the architecture of the rest of your application. React as practiced in the real world absolutely does this. Theoretically you could plug it in as just the library that does the templating, but I've never seen a real-world codebase for which that appears to be true. I'm ready to be convinced otherwise!
- mikeryan 5y agoI was on team “React is a Library” but for the most part that changed when the hooks and context API were added. The addition of those, relatively simple, tools made it possible to not need the additional state management libraries like Redux/MobX etc that, up until then, were necessary add-ons to manage state and data. This made React more of a full Framework in my opinion. That being said React can still be dropped into a relatively static page to add small bits of interactivity. So at this point React seems to span both Framework and Library depending on the use case.
- boredtofears 5y agoReact defines the shape of most of the code in your code base in a way that neither moment.js or Ramda does. You can call it a library, but it sure quacks like a framework.
- optymizer 5y agoReact is a framework, not a library.
- LAC-Tech 5y agoIn every react project I've worked on, the majority of the business logic was written inside components (the old "code behind" anti-pattern from WinForms days), and about half the files had the extension "jsx" or "tsx". It also required the use of a react specific browser extension to debug effectively. React is a de-jure library, but a de-facto framework.