UNPKG

required-react-context

Version:

A simple React Context wrapper that throws an error if it is used without being provided

2 lines 310 B
import{a as r,b as o,c as n}from"./chunk-ER4PD4M6.js";import{use as m}from"react";function i(e){return e.providerName??`${e.displayName??"Unknown"}.Provider`}function s(e){let t=m(e);return o(t!==r,"then"in e?"thenable returned UNSET_VALUE":n("use",i(e))),t}export{s as use}; //# sourceMappingURL=canary.js.map