GithubHelp home page GithubHelp logo

front-end-web-development-interview's Introduction

大厂前端面试题精选

Front-End-Web-Development-Interview

精选近期大厂常见面试题目,面试中常考到的知识点和代码实现。 包含不限于JS面试题,Vue面试题,React面试题,HTTP面试题,工程化面试题,CSS面试题,算法面试题,大厂面试题,高频面试题。

题目较深入原理源码层面,以面试题来驱动学习,提倡每日学习与思考,每天进步一点点!

欢迎提出意见,一起维护和完善这个仓库~

链接 概述 标签分类 更新状态
JavaScript.md Front End Web Development Interview JavaScript 部分 JavaScript 已完结
Vue.md Front End Web Development Interview Vue 部分 Vue 已完结
React.md Front End Web Development Interview React 部分 React 已完结
性能优化.md Front End Web Development Interview 性能优化 部分 性能优化 已完结
前端工程化.md Front End Web Development Interview 前端工程化 部分 前端工程化 已完结
浏览器.md Front End Web Development Interview 浏览器 部分 浏览器 已完结
计算机网络.md Front End Web Development Interview 计算机网络 部分 计算机网络 已完结
HTML.md Front End Web Development Interview HTML 部分 HTML 已完结
CSS.md Front End Web Development Interview CSS 部分 CSS 已完结

front-end-web-development-interview's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

front-end-web-development-interview's Issues

React 17 中移除了 “event pooling(事件池)“

问题描述

在 1. React 的事件和普通的 HTML 事件有什么不同?这个问题中,
原文出现了如下一个观点:https://github.com/muyiwoniu/Front-End-Web-Development-Interview/blob/main/questions/React.md?plain=1#L12 ,我认为这个观点需要备注上React的具体版本。

我的观点

在 React 17 相关改动这篇文章中 https://zh-hans.reactjs.org/blog/2020/08/10/react-v17-rc.html#no-event-pooling ,明确表示了React 17 中移除了 “event pooling(事件池)“。

在 React 17 中,React 将不再向 document 附加事件处理器。而会将事件处理器附加到渲染 React 树的根 DOM 容器中

问题描述

事件的执行顺序为原生事件先执行,合成事件后执行,合成事件会冒泡绑定到 document 上,所以尽量避免原生事件与合成事件混用,如果原生事件阻止冒泡,可能会导致合成事件不执行,因为需要冒泡到 document 上合成事件才会执行。

  1. 在 React 17 中,React 将不再向 document 附加事件处理器。而会将事件处理器附加到渲染 React 树的根 DOM 容器中
  2. 在 React 17 中,在树的根DOM容器上为每种事件类型(支持的)附加一个处理器,由这个事件处理器完成“委托”。

对于一般的(支持的)事件类型,附加一个捕获阶段的事件处理函数和一个冒泡阶段的事件处理函数,我猜测在 React 文档的表述中应该是把多个附加的事件处理函数逻辑上整体看作了一个事件处理器
image

参考文章

更改事件委托

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.