![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
@react-google-maps/api
Advanced tools
Readme
@react-google-maps/api@1.2.4
This library requires React v16.6 or later. If you need support for earlier versions of React, you should check out react-google-maps
This is complete re-write of the (sadly unmaintained) react-google-maps
library. We thank tomchentw for his great work that made possible.
@react-google-maps/api provides very simple bindings to the google maps api and lets you use it in your app as React components.
Here are the main additions to react-google-maps that were the motivation behind this re-write
npm i -S @react-google-maps/api
12.4kb
gzip, tree-shakeable https://bundlephobia.com/result?p=@react-google-maps/api@1.0.0<LoadScript preventGoogleFonts />
componentExamples can be found in two places:
You can save on bundle size if you import only components, which you use from @react-google-maps/api/lib/...
, although whole library is tree-shakable.
Using the examples requires you to generate a google maps api key. For instructions on how to do that please see the following guide
Maintainers and contributors are very welcome! See this issue to get started.
if you need an access to map object, instead of ref
prop, you need to use onLoad
callback on <GoogleMap />
component.
Before:
// before
<GoogleMap
ref={map => {
const bounds = new window.google.maps.LatLngBounds();
map.fitBounds(bounds);
}}
/>
After:
<GoogleMap
onLoad={map => {
const bounds = new window.google.maps.LatLngBounds();
map.fitBounds(bounds);
}}
onUnmount={map => {
// do your stuff before map is unmounted
}}
/>
Since 1.2.0 you can use onLoad and onMount props for each @react-google-maps/api component, ref does not contain API methods anymore.
Since version 1.2.2 We added useGoogleMap hook, which is working only with React@16.8.1 and later versions.
DriveFromTo.com Transfer Booking service PWA.
FAQs
React.js Google Maps API integration
The npm package @react-google-maps/api receives a total of 309,341 weekly downloads. As such, @react-google-maps/api popularity was classified as popular.
We found that @react-google-maps/api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.