diff --git a/example/App.js b/example/App.js index bca71da5..840a49f2 100644 --- a/example/App.js +++ b/example/App.js @@ -38,7 +38,7 @@ export class App extends Component { }; } - componentWillMount() { + UNSAFE_componentWillMount() { // setInterval(this.addMessage.bind(this), 3000); } diff --git a/src/MessageBox/MessageBox.js b/src/MessageBox/MessageBox.js index 4202e9fb..a3f2bcf4 100644 --- a/src/MessageBox/MessageBox.js +++ b/src/MessageBox/MessageBox.js @@ -24,7 +24,7 @@ import { import classNames from 'classnames'; export class MessageBox extends Component { - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { if (nextProps.focus !== this.props.focus && nextProps.focus === true) { if (this.refs['message']) { this.refs['message'].scrollIntoView({ diff --git a/src/MessageList/MessageList.js b/src/MessageList/MessageList.js index 5fa5cef6..4c34b863 100644 --- a/src/MessageList/MessageList.js +++ b/src/MessageList/MessageList.js @@ -35,7 +35,7 @@ export class MessageList extends Component { } } - componentWillReceiveProps(nextProps) { + UNSAFE_componentWillReceiveProps(nextProps) { if (!this.mlistRef) return; if (nextProps.dataSource.length !== this.props.dataSource.length) {