DEV Community

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

Collapse
 
peerreynders profile image
peerreynders

The litmus test:

  • If your code calls it, it's a library.
  • If it calls your code, it's a framework.

Looking at the React tutorial Starter Code ReactDOM.render() is the only part of React that your code calls. The rest, i.e. the majority of your code, is called by React.

Ipso facto - React is a framework because it is in control when most of your code runs.

For the expanded argument see: React is a (view component) framework

Collapse
 
mattwelke profile image
Matt Welke

Really good explanation. I like it has citations, because some people are very persistent in arguing Facebook's marketing that it's a library. It's confusing trying to teach junior developers about software engineering techniques when they come into the job under the impression that React isn't a framework.