Skip to content
0:00 / 0:00

#reacthooks#closures#usestate

Can Swyx recreate React Hooks and useState in under 30 min? - JSConf.Asia

JSConf

286K subscribers • 33 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Shawn Wang
  • May be out of date. Uploaded 7 years ago, in an area where tools change fast.

Intermediate. Assumes working knowledge.

83K views7 years ago2 recommendations

Web developmentProgramming languagesReactJavaScript

Shawn Wang demonstrates how React Hooks work under the hood by building a tiny clone of React using JavaScript closures.

"Getting Closure on React Hooks" presented by Shawn "Swyx" Wang at JSConf.Asia 2019 The design of React Hooks requires a good understanding of closures in JavaScript. In this talk, we’ll reintroduce closures by building a tiny clone of React! This will serve two purposes – to demonstrate the effective use of closures, and to show how you can build a Hooks clone in just 29 lines of readable JS. Finally, we arrive at how you get Custom Hooks and the Rules of Hooks out of this incredible mental model! Originally from Singapore, swyx is an Infinite Builder working on Developer Experience at Netlify. In his free time he helps people Learn in Public at Egghead.io and /r/reactjs. JSConf.Asia - LASALLE College of the Arts, Singapore - 15 June 2019 Source: 2019.jsconf.asia/ License: For reuse of this video under a more permissive license please get in touch with us. The speakers retain the copyright for their performances. Intro animation "something something prisms" by Martin Schuhfuss codepen.io/usefulthink/pen/WogmvW Intro music "Know" by Matt McKegg soundcloud.com/destroy-with-science/know

Why it's here

2 people recommend this

What people say. Recommended as an excellent mental model and live-coding demonstration of how React Hooks and closures work.

u/alanmynahin r/kubernetes • Recommends

Kubernetes from scratch Hello everyone, Been looking for a talk/project/blog that people can recommend where someone is building a toy version of kubernetes from scratch. As an example, ideally it'd be similar to Liz Rice's talk on containers, call it 'docker from scratch' or Swyx's talk on React Hooks, call it 'hooks from scratch'. Any links are highly appreciated! Thanks a lot

u/xSliverin r/Frontend • Recommends

On “About to create a meta guide for junior devs”

You should watch "Getting Closure on React Hooks" by Shawn Wang. He live codes his own "React" implementation with State-Hooks in 20 Min. [video (live coding starts at \~3:30)