Skip to content

API reference > @kontsedal/olas-react > OlasContext

OlasContext type ​

What createOlasContext<Api>() returns: a provider and useRoot typed to one root.

Signature:

typescript
type OlasContext<Api> = {
  Provider: (props: {
    root: Root<Api>;
    children: ReactNode;
  }) => ReactNode;
  useRoot: () => Api;
  Context: Context<Root<Api> | null>;
};

References: Root

Released under the MIT License.