From 4e93077feb581d47605d4329f8eed99964ca2c11 Mon Sep 17 00:00:00 2001 From: Pawan Singh <55322511+brigadierpratap@users.noreply.github.com> Date: Mon, 12 Apr 2021 13:09:16 +0530 Subject: [PATCH] UNSAFE warning for componentWillReceiveProps --- src/GoogleApiComponent.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GoogleApiComponent.js b/src/GoogleApiComponent.js index 0e2d261c..ff932fac 100644 --- a/src/GoogleApiComponent.js +++ b/src/GoogleApiComponent.js @@ -55,7 +55,7 @@ export const wrapper = input => WrappedComponent => { this.mapRef=React.createRef(); } - UNSAFE_componentWillReceiveProps(props) { + componentDidUpdate(props) { // Do not update input if it's not dynamic if (typeof input !== 'function') { return; @@ -75,11 +75,11 @@ export const wrapper = input => WrappedComponent => { // Save new options in component state, // and remove information about previous API handlers - this.setState({ + this.state= { options: options, loaded: false, google: null - }); + }; } componentWillUnmount() {
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: