3 ms·
It's somewhere in between. React as a lib and architecture _is_ platform-agnostic. The core logic is defined in the `react-reconciler` package. It contains al
by acemarke 3y ago
It's somewhere in between.
React as a lib and architecture _is_ platform-agnostic. The core logic is defined in the `react-reconciler` package. It contains all the implementation of rendering components, diffing trees, managing state, and running effects, as well as all the "Suspense" implementation.
However, the way `react-reconciler` works is that it's built _into_ each platform-specific renderer implementation. So, the size of `react-dom` is actually the size of `react-reconciler` + all the DOM-specific behavior.
A quick check of https://bundlejs.com/?q=react-reconciler https://bundlejs.com/?q=react-reconciler suggests it's about 100K minified. https://bundlejs.com/?q=react-dom https://bundlejs.com/?q=react-dom is 138K, so that tells me that the DOM-specific logic is 38K.