feat: add webpush and sadhna tracker
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { useSyncExternalStore } from "react";
|
||||
|
||||
const emptySubscribe = () => () => {};
|
||||
|
||||
/**
|
||||
* useMounted — false during SSR and the first client render, true thereafter.
|
||||
* Uses useSyncExternalStore (not an effect), so it's safe for gating
|
||||
* client-only work like createPortal without tripping the
|
||||
* set-state-in-effect rule. Mirrors the pattern in components/logo.tsx.
|
||||
*/
|
||||
export function useMounted(): boolean {
|
||||
return useSyncExternalStore(
|
||||
emptySubscribe,
|
||||
() => true,
|
||||
() => false,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user