Git Product home page Git Product logo

Comments (8)

BetaSu avatar BetaSu commented on July 17, 2024

这里Demo 的目的是为了展示useLayoutEffect的工作原理,揭示 **在这些回调方法中可能触发新的更新,新的更新会开启新的render-commit流程。**这一论点。

如果要对比 useLayoutEffectuseEffect区别,考虑在useLayoutEffect中执行些阻塞线程的工作应该会看到区别。

from just-react.

BetaSu avatar BetaSu commented on July 17, 2024

你提出的问题确实有代表性, 我会在后续 加上 这两者的对比demo。

感谢反馈

from just-react.

shaodahong avatar shaodahong commented on July 17, 2024

是的,原理我是知道的,但是 Demo 没有说服力,而且 useLayoutEffectuseEffect 也是经常问的点,结合场景会比较好

from just-react.

linsi123 avatar linsi123 commented on July 17, 2024

useEffect官网说是在浏览器渲染页面后执行的;你这里说是在commit阶段执行

from just-react.

BetaSu avatar BetaSu commented on July 17, 2024

useEffect官网说是在浏览器渲染页面后执行的;你这里说是在commit阶段执行

可以去了解下 commit阶段做的事情,这两种说法不冲突

from just-react.

linsi123 avatar linsi123 commented on July 17, 2024

为什么reconciler的mount要生成子fibre,而不是生成当前的fibre

from just-react.

BetaSu avatar BetaSu commented on July 17, 2024

为什么reconciler的mount要生成子fibre,而不是生成当前的fibre

书里有讲。

另外,useLayoutEffect Demo 更新了,关闭本issue

from just-react.

linsi123 avatar linsi123 commented on July 17, 2024

看不懂,能加你微信吗

from just-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.