jquery was a library. React is a framework because you're passing in code to React, which it then uses to do things like render components and respond to state changes.
React misleadingly called itself a library to distinguish itself from more batteries-included frameworks like Angular.
If I build an app on React, there's not much chance I'm ever going to swap it out for anything else, thus it's a framework.
If I use Twilio's JS library for sending SMS and then decide to swap to a different vendor (or a different library for the Twilio API) that's fairly easy with the right design.
Preact exists though? And literally emulates React's API. It even has a guide for aliasing the Preact module as React with your bundler so your app wouldn't need any code changes. Can a framework do that?