News for hackers. Stuff that matters.
Re:Building a web app with no framework by thrashh on Saturday March 05, 2022 @01:02PM (#30570028)
I wouldn’t call React a framework personally. To me it’s a library like moment.js or ramda.
Re:Building a web app with no framework by simonw on Saturday March 05, 2022 @01:26PM (#30570318)
I 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!

Re:Building a web app with no framework by mikeryan on Saturday March 05, 2022 @03:17PM (#30571460)
I 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.

Re:Building a web app with no framework by boredtofears on Saturday March 05, 2022 @01:32PM (#30570397)
React 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.
Re:Building a web app with no framework by LAC-Tech on Saturday March 05, 2022 @03:11PM (#30571411)
In 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.

Re:Building a web app with no framework by tashoecraft on Saturday March 05, 2022 @01:13PM (#30570146)
I’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.

Re:Building a web app with no framework by have_faith on Saturday March 05, 2022 @01:25PM (#30570295)
React 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.
Re:Building a web app with no framework by optymizer on Saturday March 05, 2022 @03:04PM (#30571351)
React is a framework, not a library.