-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gatsby componentDidUpdate() create an infinite loop #2971
Comments
It's just due to react-geolocated, too many triggers |
@pinaudnico A way to do what you want, is to inverted your logic. Add geoloc data into your parent, and give the props to children. Example: https://scrimba.com/c/cKQgNcd |
BTW, I close this issue because is not related with gatsby 😉 |
Thanks for help. |
The main goal of react is to permit to separate your ui in small/dump ui parts (easier to read/maintain and test). After it also permit to have access to all react components/plugins community 😉 So it depends of your needs. But I can totally understand that you use partially react for a specific need (if you use Gatsby for example, you don't have to deal with webpack, dev server and build) so yes, for this reason, react is still a good idea ;) BTW, I don't have all yours specs, but it's often (always?) possible to split your logic in many small modules 😉 (but it's the hard part of a developer jobs 😉 ). To finish, I also use react for a single page website, just to split my logic (example: https://github.com/fabien0102/fabien0102.com), make totally sense! |
Hi everyone,
I'm trying to make a component who can give me GPS coords. This component will update very often and I want to catch the coords in a parent. Problem : my componentDidUpdate() create an error . Wht does I miss ?
and my GPS.js 👍
The text was updated successfully, but these errors were encountered: