The difference is not so clear. The difference between a library and a framework has to do with Inversion of Control.
A library can be thought of as a bunch of procedures you call to accomplish a certain task. It is your program that calls into the library and is as such independent of the library. The program is the master and the library is a slave.
A framework on the other hand is, as the name suggests, a set of rules, conventions and protocols for how a program works. It includes most of the common infrastructural code that is a large part of apps. It also imposes standard rules about how everything is done. The code written by the user of a framework just defines in an abstract way the specifics of that particular application. It does this in a way that is expected by the framework, i.e, your code has to comply to the framework's predefined conventions about how everything will work. It is the framework code that runs first and that calls into your code to determine what has to be done at a high level. The framework is the backbone of the app and defines the general architecture of the app.
React stands at kind of a fuzzy spot. It is a framework in the sense that it absolutely does have a predefined architecture and infrastructural design and it calls into your code to fill in the details. It is a library in the sense that it only handles the UI part of the app and tries not to handle any other aspect of the app. The entry point is controlled by the user and React does not decide any conventions for other things like state management, network functionality, data storage, etc.
At the end of the day it is more important to understand how React is different from the classic examples of either a library or a framework. It often comes down to people's personal definition of what constitutes a framework or a library and what features are crucial to which definition. I like to use the term 'micro-framework', what I define as a framework that focuses on a very narrow domain.
Cheers :)