mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-08 18:53:02 +00:00
17 lines
309 B
TypeScript
17 lines
309 B
TypeScript
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
|
|
|
/**
|
|
* Determines whether or not the component tree has been hydrated.
|
|
*/
|
|
export function useIsHydrated() {
|
|
return useSyncExternalStore(
|
|
subscribe,
|
|
() => true,
|
|
() => false
|
|
);
|
|
}
|
|
|
|
function subscribe() {
|
|
return () => {};
|
|
}
|