useIsMounted function
Returns an IsMounted object that you can use to check if the State is mounted.
final isMounted = useIsMounted();
useEffect((){
myFuture.then((){
if (isMounted()) {
// Do something
}
});
}, []);
See also:
- The State.mounted property.
Implementation
IsMounted useIsMounted() {
return use(const _IsMountedHook());
}