feat: add error message in set method of context on outside of provider

This commit is contained in:
p-sw 2024-05-24 19:24:21 +09:00
parent 7ae5f7fd6d
commit 09bdb41160

View File

@ -10,7 +10,16 @@ const Tooltip$Context$InitialState: TooltipContextBody = {
}; };
const Tooltip$Context = React.createContext< const Tooltip$Context = React.createContext<
[TooltipContextBody, React.Dispatch<React.SetStateAction<TooltipContextBody>>] [TooltipContextBody, React.Dispatch<React.SetStateAction<TooltipContextBody>>]
>([Tooltip$Context$InitialState, () => {}]); >([
Tooltip$Context$InitialState,
() => {
if (process.env.NODE_ENV && process.env.NODE_ENV === "development") {
console.warn(
"It seems like you're using TooltipContext outside of a provider."
);
}
},
]);
const [Tooltip$Variant, Tooltip$resolveVariantProps] = vcn({ const [Tooltip$Variant, Tooltip$resolveVariantProps] = vcn({
base: "w-fit h-fit relative group/tooltip", base: "w-fit h-fit relative group/tooltip",