The key difference between a library and a framework is "Inversion of Control".
When you call a method from a library, you are in control. But with a framework, the control is inverted: the framework calls you.
In a framework, all the control flow is already there and there are many predefined white spots that we should fill out with our code. A framework is normally more complex. It defines a skeleton where the application defines its own features to fill out the skeleton. In this way, your code will be called by the framework appropriately.
A library performs specific, well-defined operations. A library is just a collection of class definitions. The reason is it simply code reuse, in other words, gets the code that has already been written by other developers. The classes and methods normally define specific operations in a domain-specific area. For example, there are some libraries of mathematics that can let developers just call the function without redoing the implementation of how an algorithm works.
Source: https://www.c-sharpcorner.com/uploadfile/a85b23/framework-vs-library/
One important distinction between libraries like React and frameworks like Ember.js and AngularJS is that React is concerned only with rendering the UI and leaves many things up to each project to put together. As of July 2018, a standard set of tools, often called a stack, for building a React application is as follows:
Application code:
React, Redux, react-router
Build tools:
Webpack, Uglify, npm/yarn, Babel, babel-preset-env
Testing tools:
ESLint, Enzyme, Mocha/Jest
As a point of comparison, the stack for Ember.js is Ember.js.
Source: https://www.oreilly.com/library/view/what-react-is/9781491996744/ch01.html