Skip to content

Commit 03e1d87

Browse files
Merge pull request #123 from kadirgombel/master_fix_with_UNSAFE
Surpass warnings for componentWillReceiveProps
2 parents 8f1b9f0 + 012fe98 commit 03e1d87

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

example/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class App extends Component {
4040
};
4141
}
4242

43-
componentWillMount() {
43+
UNSAFE_componentWillMount() {
4444
// setInterval(this.addMessage.bind(this), 3000);
4545
}
4646

src/MessageBox/MessageBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
import classNames from 'classnames';
2626

2727
export class MessageBox extends Component {
28-
componentWillReceiveProps(nextProps) {
28+
UNSAFE_componentWillReceiveProps(nextProps) {
2929
if (nextProps.focus !== this.props.focus && nextProps.focus === true) {
3030
if (this.refs['message']) {
3131
this.refs['message'].scrollIntoView({

src/MessageList/MessageList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class MessageList extends Component {
3535
}
3636
}
3737

38-
componentWillReceiveProps(nextProps) {
38+
UNSAFE_componentWillReceiveProps(nextProps) {
3939
if (!this.mlistRef)
4040
return;
4141
if (nextProps.dataSource.length !== this.props.dataSource.length) {

0 commit comments

Comments
 (0)