mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
Add new post
add new code sandbox component
This commit is contained in:
12
lib/hooks/useMounted.tsx
Normal file
12
lib/hooks/useMounted.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
const useMounted = () => {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
useEffect(() => setMounted(true), []);
|
||||
|
||||
return {
|
||||
mounted,
|
||||
};
|
||||
};
|
||||
|
||||
export default useMounted;
|
Reference in New Issue
Block a user