DEV Community

Discussion on: Why is React a library and not a (simple) framework?

Collapse
 
lexlohr profile image
Alex Lohr

I think you confuse react with the whole ecosystem around it.

A framework covers the edges, whereas a library is a tool to fulfill certain tasks. React itself only handles one task: abstracted Web Components. It provides an internal state, lifecycles and external properties and with ReactDOM a renderer for a browser or similar environment - and nothing more.

This has a few advantages: it is smaller than a full-featured framework, is less opinionated on how to solve problems and therefore allows for more choice. Don't like react-router? Use another one - or no router at all, if you don't need any. Need a complex state management? Try redux. Need to handle side-effects? you can choose between redux-thunks, redux-sagas and redux-observables. Unit testing can be done with enzyme, jest or mocha, sinon, chai, jasmine, karma, etc. There's no one or best way to do it, so you can do whatever works best for you.

Collapse
 
githubmarcelnoack profile image
marcelnoack

So I guess the point that you and most of the other people here want to make is, that React itself, standalone, is technically! a library but because in 95% or so percent you will use the same libraries like react-router, redux, etc., the ecosystem of react is practically! a framework.