React Big Changes All in One

React 重大更新

React Versions

React 版本变更

https://reactjs.org/versions/

semantic versioning (semver) / 语义化版本

https://semver.org/

https://reactjs.org/docs/faq-versioning.html

React 16.13.1

https://github.com/facebook/react/blob/master/CHANGELOG.md#16131-march-19-2020

React v16.13.0

https://github.com/facebook/react/blob/master/CHANGELOG.md#16130-february-26-2020

Concurrent Mode (Experimental) / 并发模式

https://reactjs.org/docs/concurrent-mode-intro.html

https://reactjs.org/docs/concurrent-mode-adoption.html

https://reactjs.org/blog/2019/11/06/building-great-user-experiences-with-concurrent-mode-and-suspense.html

React v16.9.0

https://github.com/facebook/react/blob/master/CHANGELOG.md#1690-august-8-2019

Renaming Unsafe Lifecycle Methods

componentWillMount → UNSAFE_componentWillMount

componentWillReceiveProps → UNSAFE_componentWillReceiveProps

componentWillUpdate → UNSAFE_componentWillUpdate

https://reactjs.org/blog/2019/08/08/react-v16.9.0.html

https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html

React 16.9 does not contain breaking changes, and the old names continue to work in this release.

But you will now see a warning when using any of the old names:

why init execute twice bug

https://stackblitz.com/edit/react-ifecycle-order-all-in-one?file=package.json

https://react-ifecycle-order-all-in-one.stackblitz.io/

React v16.8

React Hooks

https://github.com/facebook/react/blob/master/CHANGELOG.md#1680-february-6-2019

useState

useReducer

useEffect

useMemo

useCallback

https://reactjs.org/docs/hooks-intro.html

import React, { useState } from 'react';

function Example() {
// Declare a new state variable, which we'll call "count"
const [count, setCount] = useState(0); return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}

React v16.3.0

https://github.com/facebook/react/blob/master/CHANGELOG.md#1630-march-29-2018

React lifecycle

getDerivedStateFromProps()

getSnapshotBeforeUpdate()

React DOM

supported context API

React.createRef()

React.forwardRef()

https://reactjs.org/blog/2018/03/27/update-on-async-rendering.html#migrating-from-legacy-lifecycles

React v16.x.x

refs

JSX Transform

React 17 doesn’t contain new features, it will provide support for a new version of the JSX transform.

https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


React Big Changes All in One的更多相关文章

  1. react组件的生命周期

    写在前面: 阅读了多遍文章之后,自己总结了一个.一遍加强记忆,和日后回顾. 一.实例化(初始化) var Button = React.createClass({ getInitialState: f ...

  2. 十分钟介绍mobx与react

    原文地址:https://mobxjs.github.io/mobx/getting-started.html 写在前面:本人英语水平有限,主要是写给自己看的,若有哪位同学看到了有问题的地方,请为我指 ...

  3. RxJS + Redux + React = Amazing!(译一)

    今天,我将Youtube上的<RxJS + Redux + React = Amazing!>翻译(+机译)了下来,以供国内的同学学习,英文听力好的同学可以直接看原版视频: https:/ ...

  4. React 入门教程

    React 起源于Facebook内部项目,是一个用来构建用户界面的 javascript 库,相当于MVC架构中的V层框架,与市面上其他框架不同的是,React 把每一个组件当成了一个状态机,组件内 ...

  5. 通往全栈工程师的捷径 —— react

    腾讯Bugly特约作者: 左明 首先,我们来看看 React 在世界范围的热度趋势,下图是关键词“房价”和 “React” 在 Google Trends 上的搜索量对比,蓝色的是 React,红色的 ...

  6. 2017-1-5 天气雨 React 学习笔记

    官方example 中basic-click-counter <script type="text/babel"> var Counter = React.create ...

  7. RxJS + Redux + React = Amazing!(译二)

    今天,我将Youtube上的<RxJS + Redux + React = Amazing!>的后半部分翻译(+机译)了下来,以供国内的同学学习,英文听力好的同学可以直接看原版视频: ht ...

  8. React在开发中的常用结构以及功能详解

    一.React什么算法,什么虚拟DOM,什么核心内容网上一大堆,请自行google. 但是能把算法说清楚,虚拟DOM说清楚的聊聊无几.对开发又没卵用,还不如来点干货看看咋用. 二.结构如下: impo ...

  9. React的使用与JSX的转换

    前置技能:Chrome浏览器   一.拿糖:React的使用 React v0.14 RC 发布,主要更新项目: 两个包: React 和 React DOM DOM node refs 无状态的功能 ...

  10. Vue.js 2.0 和 React、Augular等其他框架的全方位对比

    引言 这个页面无疑是最难编写的,但也是非常重要的.或许你遇到了一些问题并且先前用其他的框架解决了.来这里的目的是看看Vue是否有更好的解决方案.那么你就来对了. 客观来说,作为核心团队成员,显然我们会 ...

随机推荐

  1. Go 如何实现热重启

    https://mp.weixin.qq.com/s/UVZKFmv8p4ghm8ICdz85wQ Go 如何实现热重启 原创 zhijiezhang 腾讯技术工程 2020-09-09  

  2. REST 架构的替代方案 为什么说GraphQL是API的未来?

    Managing enterprise accounts - GitHub Docs https://docs.github.com/en/graphql/guides/managing-enterp ...

  3. (转载)微软数据挖掘算法:Microsoft 目录篇

    本系列文章主要是涉及内容为微软商业智能(BI)中一系列数据挖掘算法的总结,其中涵盖各个算法的特点.应用场景.准确性验证以及结果预测操作等,所采用的案例数据库为微软的官方数据仓库案例(Adventure ...

  4. JQuery——相关练习

    ####JQuery的基本语法 <!--导入JQuery文件--> <script src="js/jquery-3.1.1.min.js"> /*带min ...

  5. Spark剖析-宽依赖与窄依赖、基于yarn的两种提交模式、sparkcontext原理剖析

    Spark剖析-宽依赖与窄依赖.基于yarn的两种提交模式.sparkcontext原理剖析 一.宽依赖与窄依赖 二.基于yarn的两种提交模式深度剖析 2.1 Standalne-client 2. ...

  6. cocos2d-x 调试问题

    1.昨天一个新功能,在xcode模拟器上测试没问题.后来打包安卓后,一直有问题 就又添加日志功能 #   define CCLOGFUNC(s)                             ...

  7. Java POI 导出EXCEL经典实现

    import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; i ...

  8. BGP总结(一)

    0.AS 狭义:在RIP.OSPF和EIGRP等IGP协议中,AS表示只运行此单种协议的路由域 广义:运行多个IGP协议的路由域,多个IGP协议之间通过路由重发布来实现通信,AS和AS之间通过BGP来 ...

  9. Linux-服务管理命令chkconfig

    Linux-服务管理命令chkconfig 一  chkconfig简介 chkconfig命令主要用来更新(启动或停止)和查询系统服务的运行级信息.谨记chkconfig不是立即自动禁止或激活一个服 ...

  10. Vue结合Element UI实战

    创建工程 1. 创建一个名为hello-vue的工程 vue init webpack hello-vue 2. 安装依赖 需要安装 vue-router.element-ui.sass-loader ...