google-maps-react
google-maps-react copied to clipboard
Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code.
I am currently using react 16.13.1 and google-maps-react 2.0.6. I am getting this warning on using Map and GoogleApiWrapper. "Warning: Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://fb.me/react-unsafe-component-lifecycles for details.
- Move data fetching code or side effects to componentDidUpdate.
- If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://fb.me/react-derived-state
Please update the following components: Wrapper"
I know it is not good idea but it works.
just remove <React.StrictMode>
from index.js
Why not update it to componentDidUpdate or either of the other two options provided in the React documentation? After React 16 this function will no longer work.
https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops
anyone knows if there is already an active PR for this issue?
Same for me is it posible to fix this bug to make this package alive ?
Would be great to have this fixed.
anyone knows if there is already an active PR for this issue?
anyone?
hear is the fixer , Step 1: go to node_modules > google-maps-react > GoogleApiComponent.js > { change line no. 149 & 150 UNSAFE_componentWillReceiveProps --> componentDidUpdate }
Step 2: then install npm i patch-package
Step 3: add this line in pkg.json
"scripts": {
+ "postinstall": "patch-package"
}
Step 4: then install npx patch-package package-name
There you go just simple restart application and you are done
hear is the fixer , Step 1: go to node_modules > google-maps-react > GoogleApiComponent.js > { change line no. 149 & 150 UNSAFE_componentWillReceiveProps --> componentDidUpdate } Step 2: then install
npm i patch-package
Step 3: add this line in pkg.json "scripts": { + "postinstall": "patch-package" } Step 4: then installnpx patch-package package-name
There you go just simple restart application and you are doneSir ,npx patch-package package-name (What is that "package-name") bro , tks
Context: patch-package is a npm library use to make any changes in node_modules libraries , some times pkgs like this (google-maps-react) cause some error and we really really need them to use in our react application so we just fix them rather sending pull on git