({ children }: { children: React.ReactNode })
| 3 | const WindowContext = createContext<string>("default") |
| 4 | |
| 5 | export function WindowProvider({ children }: { children: React.ReactNode }) { |
| 6 | const windowId = useMemo(() => { |
| 7 | return getWindowId() |
| 8 | }, []) |
| 9 | |
| 10 | return ( |
| 11 | <WindowContext.Provider value={windowId}> |
| 12 | {children} |
| 13 | </WindowContext.Provider> |
| 14 | ) |
| 15 | } |
| 16 | |
| 17 | export function useWindowId(): string { |
| 18 | return useContext(WindowContext) |
nothing calls this directly
no test coverage detected