Comments (7)
Hi @trekhleb
Can you please have at this issue and also the fix provided by @mewben at #8 . This problem has been sitting here for 6 months, and its been super annoying because it triggers the re-render of the component like an infinite loop. :(
from use-position.
Hey folks, it should be fixed now in 0.0.7
. Thanks @mewben for the fix!
from use-position.
@pocesar Can you post an example of how you implemented useMemo in this hook? Thank you.
from use-position.
const settings = useMemo(() => {
return { enableHighAccuracy: true }
}, [])
const { latitude, longitude, timestamp, accuracy, error } = usePosition(true, settings)
from use-position.
I'm having same issue.
from use-position.
@trekhleb - Should we be using useSubscription here? See: https://github.com/facebook/react/pull/15022/files#diff-f3a2eff7618256a34a255026486e7e9fR7
from use-position.
@trekhleb I'm having this issue crop up in 0.0.7
.
I'm fetching the geolocation using your tool for my weather app data, and it's repeatedly calling the api to fetch the weather.
Thanks for creating this great tool. How would I reduce the number of times that I'm calling to the API?
from use-position.
Related Issues (15)
- Can we get a location if app is killed or web is not running? HOT 5
- Callback function to run when the user location is changed? HOT 2
- Is speed available too? HOT 1
- Trigger usePosition() onClick HOT 1
- Latitude and longitude does not get updated after geolocation change HOT 1
- usePosition() not working in desktop safari version 13.1.1 HOT 7
- location is not accurate HOT 1
- We should add 1 more parameter "askForLocationPermission:true" by default
- Continually getting undefined for long and lat values HOT 4
- usePosition not returning bearing HOT 3
- can't install with react 18.2.0 HOT 1
- Not working while deploying
- Create @types/use-position npm package to use the library also with Typescript HOT 2
- [Violation] Only request geolocation information in response to a user gesture HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-position.