top | item 41841176

(no title)

mzronek | 1 year ago

A common misconception. React is a library.

These are examples for React frameworks: https://react.dev/learn/start-a-new-react-project#production...

Next.js is a React framework.

If Payload is a framework or not is debatable. I think it's more like a data layer around a database for a any js app and an Admin Panel (that uses Next.js now). It might be called a framework for your own Headless CMS, because it is code first. So you basically code the panel and the data structure yourself.

discuss

order

_heimdall|1 year ago

React hasn't been a library since they added hooks.

Hooks themselves are just a solution to async code, but the implication was that react was no longer a state-based UI rendering library and became a full blown frontend framework.

threetonesun|1 year ago

Hard to call something a full blown front end framework when it doesn’t have routing.

gloosx|1 year ago

Can you please guide me where this heresy is being spread?

flockonus|1 year ago

React started as a library.. at this point it has server side components, and a world of plugins.

As for anything that has patterns of building with, will argue it's a framework.

math_dandy|1 year ago

React is a FEBEFUIRT - a FrontEnd/BackEnd-Fluid UI RunTime.

meiraleal|1 year ago

React was a library before hooks. Now it is a framework and decides when your code runs, not you. And now it is a terrible framework with server components.

sneek_|1 year ago

I think server components have been very badly marketed. They're totally opt-in, so I don't see how this would make React instantly a terrible framework. I for one think they represent a lot of value.

If you don't use them, then React is quite literally no different to you.

gloosx|1 year ago

Can you please guide me where this heresy is being spread?

vasergen|1 year ago

> React is a library

Can a library have compiler?)

gloosx|1 year ago

Javascript has a compiler called Babel, which plays a huge role in modern web development. It is in fact a transcompiler, meaning it doesn't turn your javascript into bytecode, it is just transpiling stuff without changing the level of abstraction.

React Compiler is just a babel plugin for automatic performance improvement, memoization specifically, for never perfectly memoized React code.

Can library have compiler? Well why can't it? For example stdlib has a compiler, because C does.

robertlagrant|1 year ago

That's an optional step for JSX cross-compilation. It's a language plugin; nothing really to do with frameworks or libraries.

cooperadymas|1 year ago

A sword is also just a knife. And a Tesla truck is just an electric go-kart.