You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
import * as React from 'react';
|
|
export default function useDestroyed() {
|
|
var mountedRef = React.useRef(true);
|
|
React.useEffect(function () {
|
|
return function () {
|
|
mountedRef.current = false;
|
|
};
|
|
}, []);
|
|
return function () {
|
|
return !mountedRef.current;
|
|
};
|
|
} |