-
Notifications
You must be signed in to change notification settings - Fork 817
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
Cancel any pending requests if component is unmounted #248
Comments
@OsamaShabrez Did you ever resolve this issue? |
@afuller611-animas no, I used this library in a small project for some prototyping and never got back to it. Generally, if nothing else works, a state can be kept as a class field which can be queried before calling setState. A very quick dirty code: class MyClass extends Component {
isMounted = false;
componentDidMount() { isMounted = true; }
componentWillUnmount() { isMounted = false; }
} query this field before calling setState. |
Yeah, was hoping to resolve this without using that method -- but it gets the job done since I can't control this library. Thanks a ton. |
If you quickly switch between different components and Map is still loading, react complains of memory leak.
We need something similar to axios pending request cancelation in this library to cancel all pending requests and gracefully let the component unmount.
The text was updated successfully, but these errors were encountered: