mirror of
https://github.com/google-map-react/google-map-react.git
synced 2025-12-08 18:26:32 +00:00
Add UNSAFE_ prefix to deprecated lifecycle methods (#778)
* add UNSAFE_ prefix to deprecated lifecycle methods * add missing line break
This commit is contained in:
parent
9a18d5b3d3
commit
f5bb716291
@ -15,7 +15,7 @@ const prop2Stream = (propName, comparator = (a, b) => a === b) =>
|
||||
comparator
|
||||
);
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
this.props$.next(nextProps[propName]);
|
||||
}
|
||||
|
||||
|
||||
@ -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 }));
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user