Reacton its own it just a library that allows us to define components, elements and so on + it does the diffing part. Most of the actual implementation lives in the renders. They begin the reconciliation process. They generate the tree of elements and insert it wherever it has to be inserted. You can create your own renderer using the react-test-renderer package.
In terms of web development, we usually only import React DOM once and call its render() method. How can most of the implementation live in the render package? The key to understanding this is to know that React communicates with the rendered. There are many ways of React doing that, but let's explore one of them, the setState function.
How exactly does setState() work?
set State is part of class components and the answer is that every renderer sets a special field on the created class. This field is called updater. When we use React on the web, it is React DOM that sets this field right after creating an instance of the class.
What about React Hooks?
React hooks basically do the same thing, however, instead of an updater field, they use a dispatcher object. Internally, it looks similarly to this.