-
-
Notifications
You must be signed in to change notification settings - Fork 855
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
fix for Maximum update depth exceeded Feature Request #916
Comments
I'm having the same issue. The |
I've fixed this. So instead of using:
I change to:
|
@nguyendinhdoan Life savior ! It fixes the issue :)
|
@nguyendinhdoan Thanks! It works! |
@nguyendinhdoan Thank you so much ~ For those of you unlucky ones like me maintaining an ancient codebase, and after a routine SDK update, your client informs you next day that the app is crashing (what else is new?), you spend hours through thousands of lines of spaghetti code, only to discover—surprise!—it's GooglePlacesAutocomplete causing the havoc. Here is what you do for class component -
|
I was getting error "Maximum update depth exceeded".
So I checked you file GooglePlacesAutocomplete.js
In that I noticed in you useEffect:
useEffect(() => {
// This will load the default value's search results after the view has
// been rendered
_handleChangeText(stateText);
return () => {
_abortRequests();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.query]);
I think your props.query in your dependency array is causing onChangeText of textInputProps to continuously run making _handleChangeText change state continuously , I removed props.query and had an empty dependency array. then there was no issue.
Also if you give stateText then also no issue comes.
please check it, and update it accordingly
The text was updated successfully, but these errors were encountered: