scrabble-solver
Version:
Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.
18 lines (11 loc) • 452 B
text/typescript
import { createContext, useContext } from 'react';
import { type useTooltip } from './useTooltip';
type TooltipContextType = ReturnType<typeof useTooltip> | null;
export const TooltipContext = createContext<TooltipContextType>(null);
export const useTooltipContext = () => {
const context = useContext(TooltipContext);
if (context === null) {
throw new Error('Tooltip components must be wrapped in <Tooltip />');
}
return context;
};