MCPcopy Create free account
hub / github.com/BetaSu/big-react / createContext

Function createContext

packages/react/src/context.ts:4–15  ·  view source on GitHub ↗
(defaultValue: T)

Source from the content-addressed store, hash-verified

2import { ReactContext } from 'shared/ReactTypes';
3
4export function createContext<T>(defaultValue: T): ReactContext<T> {
5 const context: ReactContext<T> = {
6 $$typeof: REACT_CONTEXT_TYPE,
7 Provider: null,
8 _currentValue: defaultValue
9 };
10 context.Provider = {
11 $$typeof: REACT_PROVIDER_TYPE,
12 _context: context
13 };
14 return context;
15}

Callers 2

main.tsxFile · 0.90
Context.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected