Sunny-117 / js-challenges

✨✨✨ Challenge your JavaScript programming limits step by step
https://juejin.cn/column/7244788137410560055
1.91k stars 232 forks source link

实现简易版的useState #502

Open Sunny-117 opened 8 months ago

Sunny-117 commented 8 months ago
  1. 基于fiber
  2. 不限
Windseek commented 3 months ago

const useState = (v) => { const setV = (_v) => { v = _v }; render(); return [v, setV] }