margox / braft-editor

美观易用的React富文本编辑器,基于draft-js开发
MIT License
4.6k stars 592 forks source link

出现警告一些react生命周期函数即将过时,建议修改 #635

Open kingller opened 4 years ago

kingller commented 4 years ago

Hi, 升级react至16.9.0后,出现如下警告,建议修改

backend.js:6 Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move code with side effects to componentDidMount, and set initial state in the constructor.
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: BraftEditor

backend.js:6 Warning: componentWillReceiveProps has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: BraftEditor, DropDown, LinkEditor, TextAlign

backend.js:6 Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

* Move data fetching code or side effects to componentDidUpdate.
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run `npx react-codemod rename-unsafe-lifecycles` in your project source folder.

Please update the following components: DraftEditor
eugle commented 4 years ago

同样的问题

goldenshooter commented 4 years ago

同样的问题。 image @margox 呼唤刚哥

OnionStu commented 4 years ago

同样的问题

devforma commented 4 years ago

同样的问题

lxxxv5 commented 4 years ago

同样的问题。

PiscineMolitorPatel commented 4 years ago

同样的问题

lzf14250 commented 3 years ago

这个项目是不是不维护了,非常喜欢这个编辑器!