

Its main benefits are an easier local setup for large projects consisting of multiple independent parts and better code reusability between them. The React repo holds 30+ packages including react, react-dom, react-server, react-devtools and many others whose purpose I don’t know. A monorepo is a single repository that hosts multiple different applications or libraries. Instead, I saw one named packages, immediately knowing that I’m looking at a monorepo. I opened the repository with the expectation to find a src directory. Hopefully, we can draw inspiration from their decisions. We’ll see what practices and patterns the React core team has applied to a piece of software used by countless engineers. I will focus on the design of the codebase instead. In fact, some of my assumptions about that will probably be wrong. I opened React’s repository but this time with the intent to read the code.īefore you continue reading, I have to mention that this is not meant to be an exhaustive overview of how React works under the hook. But it wasn’t until this year that my curiosity finally overwhelmed me. Of course, I know this and that about the virtual DOM and the reconciliation algorithm. I’ve always seen React as a black box that takes JSX and puts things on the screen without thinking too much about it.

It’s daunting to even think about reading the code of a framework I’ve been using for years.
