({ initial, children }: PageDataProviderProps)
| 26 | } |
| 27 | |
| 28 | export function PageDataProvider({ initial, children }: PageDataProviderProps) { |
| 29 | const [data, setData] = useState<PageData>(initial); |
| 30 | const value = useMemo(() => ({ data, setData }), [data]); |
| 31 | |
| 32 | return <PageDataContext.Provider value={value}>{children}</PageDataContext.Provider>; |
| 33 | } |
| 34 | |
| 35 | function usePageDataContext(): PageDataContextValue { |
| 36 | const ctx = useContext(PageDataContext); |
nothing calls this directly
no outgoing calls
no test coverage detected