mirror of
https://github.com/outline/outline.git
synced 2026-01-05 18:49:53 -06:00
* mention issue works * pr and loading works * error node * tweak mention display * handle multiple creation error * tidy * store unfurl in mention attrs * simplify mention code creation * test fix * base feedback * update node when pos is available * delete local UnfurlsStore * use unfurl from store * Optimize lodash isMatch import statement * fix: Copy/paste of issue mentions fix: Icon alignment fix: Error and loading mentions are unselectable * Switch order in paste menu --------- Co-authored-by: Tom Moor <tom@getoutline.com>
20 lines
431 B
TypeScript
20 lines
431 B
TypeScript
import * as React from "react";
|
|
|
|
/**
|
|
* Hook to check if component is still mounted
|
|
*
|
|
* @returns {boolean} true if the component is mounted, false otherwise
|
|
*/
|
|
export default function useIsMounted() {
|
|
const isMounted = React.useRef(false);
|
|
|
|
React.useEffect(() => {
|
|
isMounted.current = true;
|
|
return () => {
|
|
isMounted.current = false;
|
|
};
|
|
}, []);
|
|
|
|
return React.useCallback(() => isMounted.current, []);
|
|
}
|