1import { createContext, useContext } from "react"; 2 3/** 4 * A React context for sharing the `selected` state of an element. 5 */ 6 7export const SelectedContext = createContext(false); 8 9/** 10 * Get the current `selected` state of an element. 11 */ 12 13export const useSelected = (): boolean => { 14 return useContext(SelectedContext); 15}; 16 17