Skip to content

cxphoe/mini-react

Repository files navigation

mini-react

基于 React Fiber 的实现

代码示例:https://codesandbox.io/s/github/cxphoe/mini-react

Features

  • vnode 实现(React.createElement 实现)
  • fiber node 实现
  • reconcile 调和
  • 事件委托处理
    • 实现的事件:
      • onClick
      • onInput
      • onKeyDown
      • onKeyPress
      • onKeyUp
      • onMouseOver
      • onMouseOut
  • 类组件
    • 生命周期
    • setState
      • 异步更新(批量合并处理,在生命周期内/在事件回调中)
      • 同步更新 (异步回调中的处理)
  • 函数组件
    • hook
      • useState
      • useReducer
      • useEffect
  • 调度

Build

yarn build

About

React Implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published