excuse me ,how could I use the data from the react-geolocation
Answerhua opened this issue · comments
Answerhua commented
Hello, I am a react novice. I wonder that how could I use the data from the react-geolocation but not just
display data to the screen.
I am sorry to bother you.
Thank you very much
Jake Foraker commented
You can study React Components, Props and State: https://facebook.github.io/react-vr/docs/components-props-and-state.html
And then pass the data to your own components via props. Something like this...
<Geolocation
render={({
position: { coords: { latitude, longitude } = {} } = {}
}) => (
<div>
<MyMap latitude={latitude} longitude={longitude} />
</div>
)}
/>
Then in your MyMap
component, you'll have full access to the data and do whatever you please!
Kye Hohenberger commented
I've used https://github.com/PaulLeCam/react-leaflet in the past and liked it.