({
children,
starCount,
}: {
children: ReactNode;
starCount: StarCountType;
})
| 6 | const StarCountContext = createContext<StarCountType>(undefined); |
| 7 | |
| 8 | export function StarCountProvider({ |
| 9 | children, |
| 10 | starCount, |
| 11 | }: { |
| 12 | children: ReactNode; |
| 13 | starCount: StarCountType; |
| 14 | }) { |
| 15 | return ( |
| 16 | <StarCountContext.Provider value={starCount}> |
| 17 | {children} |
| 18 | </StarCountContext.Provider> |
| 19 | ); |
| 20 | } |
| 21 | |
| 22 | export function useStarCount(): StarCountType { |
| 23 | return useContext(StarCountContext); |
nothing calls this directly
no outgoing calls
no test coverage detected