Giter Club home page Giter Club logo

fed-e-task-04-01's Introduction

fed-e-task-04-01

  1. 请简述 React 16 版本中初始渲染的流程 解答:
  1. 为什么 React 16 版本中 render 阶段放弃了使用递归 解答: V16之前的递归算法有以下几个缺点:
  • 任务开始之后,无法中断
  • 如果应用中的组件数量庞大,主线程会被长期占用,直到整个DOM树对比更新完成后才被释放
  • 占用期间,主线程无法执行其他任务
  • 此时有交互或动画任务,无法被立即执行
  • 页面可能会出现卡顿,影响用户体验
  1. 请简述 React 16 版本中 commit 阶段的三个子阶段分别做了什么事情 解答:
  • 处理类组件中的 getSnapShotBeforeUpdate
  • 将workInProgress Fiber树转变为 current Fiber 树
  • 重置 nextEffect
  1. 请简述 workInProgress Fiber 树存在的意义是什么 解答: 利用workInProgress Fiber 树实现双缓存,加快DOM对象的快速更新

fed-e-task-04-01's People

Contributors

sylvanase avatar

Watchers

James Cloos avatar  avatar

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.