Skip to content

yudc13/jira

Repository files navigation

Hook 发展史

Mixins

  1. 优点
    1. 代码重用
  2. 缺点
    1. 命名冲突
    2. 隐式依赖

HOC

  1. 优点
    1. 容器组件和展示组件分离
  2. 缺点
    1. 不直观 难以阅读
    2. 组件层层嵌套

Render Prop

  1. 优点
    1. 灵活
  2. 缺点
    1. 不直观 难以理解

hook

  1. 优点
    1. 提取公用逻辑比较简单
    2. 容易组合
    3. 可读性强
    4. 没有名字冲突
  2. 缺点
    1. 只能在组件的顶层使用,只能在函数组件中使用
    2. 原理为闭包,容易产生意想不到的问题

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published