Giter Site home page Giter Site logo

Comments (7)

samhwang avatar samhwang commented on July 30, 2024 3

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.

trekhleb avatar trekhleb commented on July 30, 2024 2

Hey folks, it should be fixed now in 0.0.7. Thanks @mewben for the fix!

from use-position.

kcoyner avatar kcoyner commented on July 30, 2024

@pocesar Can you post an example of how you implemented useMemo in this hook? Thank you.

from use-position.

pocesar avatar pocesar commented on July 30, 2024

@kcoyner

const settings = useMemo(() => {
  return { enableHighAccuracy: true }
}, [])

const { latitude, longitude, timestamp, accuracy, error } = usePosition(true, settings)

from use-position.

pumppi avatar pumppi commented on July 30, 2024

I'm having same issue.

from use-position.

hally9k avatar hally9k commented on July 30, 2024

@trekhleb - Should we be using useSubscription here? See: https://github.com/facebook/react/pull/15022/files#diff-f3a2eff7618256a34a255026486e7e9fR7

from use-position.

techieeliot avatar techieeliot commented on July 30, 2024

@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.
Screen Shot 2020-05-13 at 4 43 05 PM

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.