Get the latest tech news

Implementing React from Scratch


A detailed explanation of the architecture I used to rebuild react

The actual code i wrote for this seems quite a bit more convoluted than what I described since there's some book keeping needed because of conditional elements (empty slots). While SomeComponet does read data provided by SomeContext.Provider, SomeContext.Provider simply broadcasts a value, it's not creating react state that can be updated + cause a re-render (there is no setter associated with it). To avoid this, I ended up performing a minor optimization and de-normalizing the view tree by storing the parent as a property on the child node.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Scratch

Scratch

Photo of Implementing React

Implementing React

Related news:

News photo

Writing a C Compiler: Build a Real Programming Language from Scratch

News photo

Show HN: SpecOS – A 64 bit OS kernel from scratch

News photo

HTTP/1.0 from Scratch