weijar
V2EX  ›  Vue.js

Vue 版的 React Hooks 可以说是青出于蓝而胜于蓝

  •  
  •   weijar · Jun 10, 2019 · 4093 views
    This topic created in 2553 days ago, the information mentioned may be changed or developed.
    https://zhuanlan.zhihu.com/p/68477600

    全面转向 Hooks 风格了,api 大幅简化,而且还避免了 React Hooks 的缺点。

    我正在写的项目全面在用 React Hooks,优点相对于 class 方式很大,但缺点同样有点难受,比如 https://overreacted.io/zh-hans/a-complete-guide-to-useeffect/ 有一部分说明,主要是因为组件函数每次 render 都要运行一次带来的,而 Vue 版没这个最大的缺点。
    2 replies    2019-07-04 11:33:16 +08:00
    liximomo
        1
    liximomo  
       Jun 20, 2019
    现在已经可以开始使用了 https://zhuanlan.zhihu.com/p/69868003
    SilentDepth
        2
    SilentDepth  
       Jul 4, 2019
    其他的都很好,就是 reactive wrapper 带来的 .value 略蛋疼
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2760 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 00:19 · PVG 08:19 · LAX 17:19 · JFK 20:19
    ♥ Do have faith in what you're doing.