Add UNSAFE_ prefix to deprecated lifecycle methods (#778)

* add UNSAFE_ prefix to deprecated lifecycle methods

* add missing line break
This commit is contained in:
Joe Maffei 2019-09-20 12:41:26 -05:00 committed by Michael Diego
parent 9a18d5b3d3
commit f5bb716291
4 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ const prop2Stream = (propName, comparator = (a, b) => a === b) =>
comparator
);
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
this.props$.next(nextProps[propName]);
}

View File

@ -10,7 +10,7 @@ const stream2Props = props2Stream =>
return class extends Component {
state = {};
componentWillMount() {
UNSAFE_componentWillMount() {
this.subscription = props2Stream(this.props).subscribe(value =>
this.setState({ value }));
}

View File

@ -21,7 +21,7 @@ const withStateSelector = (stateName, stateUpdaterName, selectorFactory) =>
callback
);
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// reselect memoize result
const nextStateValue = this.selector(nextProps);
if (nextStateValue !== this.state.stateValue) {

View File

@ -293,7 +293,7 @@ export default class GoogleMap extends Component {
}
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (process.env.NODE_ENV !== 'production') {
if (!shallowEqual(this.props.defaultCenter, nextProps.defaultCenter)) {
console.warn(