BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/Sora UI/lib-get-strict-context

getStrictContext

sora-ui/lib-get-strict-context
FreeUtility

A hook that allows you to create a strict context.

Install it

npx shadcn@latest add https://ui.soralabs.io.vn/r/lib-get-strict-context.json

Source

registry/lib/get-strict-context/index.tsxui.soralabs.io.vn/r/lib-get-strict-context.json
1import * as React from "react";
2
3function getStrictContext<T>(
4 name?: string
5): readonly [
6 ({
7 value,
8 children,
9 }: {
10 value: T;
11 children?: React.ReactNode;
12 }) => React.JSX.Element,
13 () => T,
14] {
15 const Context = React.createContext<T | undefined>(undefined);
16
17 const Provider = ({
18 value,
19 children,
20 }: {
21 value: T;
22 children?: React.ReactNode;
23 }) => <Context.Provider value={value}>{children}</Context.Provider>;
24
25 const useSafeContext = () => {
26 const ctx = React.useContext(Context);
27 if (ctx === undefined) {
28 throw new Error(`useContext must be used within ${name ?? "a Provider"}`);
29 }
30 return ctx;
31 };
32
33 return [Provider, useSafeContext] as const;
34}
35
36export { getStrictContext };

Files it writes

  • registry/lib/get-strict-context/index.tsx

Facts

Registry
Sora UI
Type
registry:lib
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-12
Last confirmed
yesterday

Go to the source

ui.soralabs.io.vn Raw registry item This item as JSON

More from Sora UI

All 97 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Ease & Spring Tokenslib-easeSora UIUtilitiesFreeno deps
Scroll Trigger Utilslib-scroll-trigger-utilsSora UIUtilitiesFreeno deps

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex