mirror of
https://github.com/MetaFam/TheGame.git
synced 2026-01-13 00:28:15 -05:00
17 lines
381 B
TypeScript
17 lines
381 B
TypeScript
import { useEffect, useState } from 'react';
|
|
|
|
export * from './useUser';
|
|
export * from './useWeb3';
|
|
|
|
// https://www.joshwcomeau.com/react/the-perils-of-rehydration/
|
|
export const useMounted = (): boolean => {
|
|
const [mounted, setMounted] = useState(false);
|
|
useEffect(() => {
|
|
setMounted(true);
|
|
return () => {
|
|
setMounted(false);
|
|
};
|
|
}, []);
|
|
return mounted;
|
|
};
|