File Structuring in React Core

these are notes from Dan Abramov's deep dive on smooshcast

referring to react core library, at packages/react-reconciler/src/ReactFiberBeginWork.js

it's really important that in a particular phase you're allowed to do particular things

to have a mental map of what each bit does in React, here's some html elements:

<div>
  <h1><strong>Tie</strong> <a>tle</a></h1>
  <h3>subtitle</h3>
  <span>description</span>
</div>

therefore all relevant logic is structured in

*these are the three central files in the codebase

We have been burned (in React Core development) in the past by over-abstracting things ... you have a hundred small modules and no idea how they relate to each other - Dan Abramov

so now the code is laid out in a way where you think "if this code runs in begin phase then i'll just go to BeginWork

in fact, React's (16+) codebase is written in a pattern called colocation (meaning: put related stuff as close to each other as possible), as mentioned at this point.

Kent C. Dodds argues for the benefits of colocation of code here

####The concept of co-location can be boiled down to this fundamental principle:

Place code as close to where it's relevant as possible

You might also say: "Things that change together should be located as close as reasonable." (Dan Abramov said something like this to me once). - Kent C. Dodds