DEV Community

Discussion on: What's the difference between a library and a framework?

Collapse
 
jrwren profile image
Jay R. Wren

The old definition was:

A library is code you call. A framework is code that calls your code.

React is a library. You know exactly where you call it and what it does. It is called at that one point where you call React.createComponent.

Other packages are frameworks which do far more magic. You include them and they call your code based on naming conventions or callbacks which you setup, but you don't control when. That is what makes them a framework.