Skip to content

cxphoe/mini-react

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f61c2e2 · Oct 10, 2019

History

17 Commits
Oct 9, 2019
Oct 10, 2019
Oct 9, 2019
Oct 7, 2019
Oct 7, 2019
Oct 7, 2019
Oct 7, 2019
Oct 9, 2019
Oct 7, 2019
Oct 7, 2019
Oct 7, 2019
Oct 8, 2019
Oct 7, 2019

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