React 16.9.0 deprecated lifecycles (#861)

This commit is contained in:
Hossein Moradi Davijani 2019-08-12 22:31:40 +04:30 committed by Xiaoji Chen
parent e7fa38fc16
commit 7aa7dff0b6
7 changed files with 7 additions and 7 deletions

View File

@ -93,7 +93,7 @@ export default class Example extends Component {
autobind(this);
}
componentWillMount() {
UNSAFE_componentWillMount() {
const colors = ['red', 'green', 'blue'];
let i = 0;
window.setInterval(

View File

@ -32,7 +32,7 @@ export default class App extends Component {
};
}
componentWillMount() {
UNSAFE_componentWillMount() {
window.onresize = () =>
this.setState({
viewport: {

View File

@ -80,7 +80,7 @@ export default class StyleDiffingExample extends Component {
this._onClick = this._onClick.bind(this);
}
componentWillMount() {
UNSAFE_componentWillMount() {
const colors = ['red', 'green', 'blue'];
let i = 0;
this._intervalId = window.setInterval(

View File

@ -245,7 +245,7 @@ export default class InteractiveMap extends PureComponent<InteractiveMapProps, S
this._updateInteractiveContext({mapContainer});
}
componentWillUpdate(nextProps: InteractiveMapProps, nextState: State) {
UNSAFE_componentWillUpdate(nextProps: InteractiveMapProps, nextState: State) {
this._setControllerProps(nextProps);
if (nextState.isDragging !== this.state.isDragging) {

View File

@ -8,7 +8,7 @@ import '../stylesheets/main.scss';
class App extends Component {
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.location !== nextProps.location) {
this.props.setHeaderOpacity(1);
this.props.toggleMenu(false);

View File

@ -89,7 +89,7 @@ export default class MarkdownPage extends PureComponent {
this._jumpTo(this.props.query.section);
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.content !== this.props.content) {
this.setState({
html: renderMarkdown(nextProps.content)

View File

@ -14,7 +14,7 @@ class Page extends Component {
};
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const {route} = nextProps;
if (this.props.route !== route) {
this.setState({