Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-google-maps
Advanced tools
React.js Google Maps integration component
npm i --save react-google-maps
Static hosted demo site on GitHub. The code is located under examples/gh-pages folder.
This module requires to be bundled with webpack/browserify and loads react/addons
internally.
First, clone the project.
git clone ...
Install docker@^1.6.2
, docker-compose@^1.3.0
and optionally boot2docker@^1.6.2
. Then,
docker-compose run --service-ports web
Then open http://192.168.59.103:8080.
192.168.59.103 is actually your ip from boot2docker ip
.
If you change code in your local, you'll need to rebuild the image to make changes happen.
docker-compose rebuild
Install node@^0.12.4
. Then,
npm install
cd examples/gh-pages
npm install
npm start
Then open http://localhost:8080.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)2.0.0 (2015-08-07)
This commit rewrite this module from scratch.
GoogleMaps -> GoogleMap
OverlayView - Now only accepts single child
Remove asynchronous loading support
The props are not directly served as options for all google.maps instance.
To set an option directly, you can now pass options object just the same way as using Google Maps JavaScript APIs.
Expose props have two representation: controlled & uncontrolled
default${ PropName }
name${ propName }
as you expectedUncontrolled props will be used only when the instance first mounted
Controlled props will call its corresponding setters every time rendered
MIGRATION GUIDE:
It introduces controlled property concept into the module. Most of the case, your application would like to have uncontrolled property. So change your component like this:
Before (v1.x.x):
<Marker
key={this.props.key}
position={this.props.position}
animation={this.props.animation}
onRightclick={this.handleMarkerRightclick} />
After (v2.x.x):
<Marker
key={this.props.key}
defaultPosition={this.props.position}
defaultAnimation={this.props.animation}
onRightclick={this.handleMarkerRightclick} />
The properties with default- prefix is uncontrolled property. It will only be set ONCE when the component is first-time mounted. Any further changes to your React props/state will NOT affect this marker (So it's uncontrolled from the view of React). Who can change the marker, you may ask. The answer is, only the component from google.maps.
But sometimes, we may want the marker's position changed according to current state. In that case, you have to provide controlled property to the <Marker [position={this.state.position}>
. By doing so, the marker's position will change every time the React props/state changes. However, it will not intercept the changes made by the component from google.maps. This is because for the <Marker>
itself, it doesn't know what events from google.maps will change its component. So the consumer who uses "react-google-maps" will have to manually handle this in their codebase.
(081d03f1)
<a name"1.7.1"></a>
FAQs
React.js Google Maps integration component
The npm package react-google-maps receives a total of 42,715 weekly downloads. As such, react-google-maps popularity was classified as popular.
We found that react-google-maps demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.