Flynn Buckingham

@flynnbuckingham

A React (+ Redux) replacement in 40 lines of code

Browsing the JavaScript sub-Reddit the other day, I was greeted by a peculiar thread called innerself:

At the time it was only 30 lines of JavaScript, but has slightly grown since

Unsure as to whether or not it was click-bait, I followed the link and was pleasantly surprised when I discovered an entire vanilla (no-library) implementation of React-like components, and a state management system (comparable to Redux) all clocked at a tiny 400-ish Bytes (minified). It uses complete vanilla ES2015 code, which even now comes with a sanitation functionality that helps remove bad, unwanted tags.

If you were hoping to contribute to the “next big thing” in the open-source community, I recommend that you check this out for yourself.

I even made a couple of pull requests, one where I was way over my head, and another where I managed to switch his example from building with a Makefile to using npm scripts.

Anyways, I thought I’d share this awesome conceptual project with Hacker Noon, to help give readers a fresh perspective on what React and Redux really does. Seeing a functional framework in such a small size helps shed some light on the mechanics on the Goliath that is React.

Make sure to leave some applause if you think this is awesome, and make sure to check out his Reddit post and consider leaving your thoughts or ideas. His project is getting stars like crazy (considering it was only released a couple of days ago).

More by Flynn Buckingham

Topics of interest

More Related Stories