Member-only story
Chapter 27: Why Did I Hear About Declarative Programming for the First Time When I Learned React?
Free video for non-members
Watch the video on YouTube
Layer of software development:
Machine language
Assembly language
Advanced languages — C, C++, Python, JavaScript, etc.
React is not a language. React is a JavaScript library. The team at Meta wrote thousands of lines of JavaScript code and gave it the name useState(). They coded another thousand lines of JavaScript code and called it createRoot(), etc. Those thousands of lines are invisible to users. Developers install libraries from NPM, import them into the files and components where they need them, and use them as declarations.
In package.json, we can see which libraries we have installed. For example:
“dependencies”: {
“react”: “¹⁹.2.6”,
“react-dom”: “¹⁹.2.6”
},
Example of an import in the entry-level main.jsx:
import { createRoot } from ‘react-dom/client’
Example of using it in code:









