# Type alias ContextType<C>

ContextType<C>: C extends Context<infer T>
? T
: never

Used to retrieve the type of a context object from a Context.

#### Type Parameters

- C extends Context<any>

  The context object.

#### Example

    import { createContext } from 'react';

    const MyContext = createContext({ foo: 'bar' });

    type ContextType = ContextType<typeof MyContext>;
    // ContextType = { foo: string }

- Defined in common/temp/node_modules/.pnpm/@types+react@18.3.3/node_modules/@types/react/index.d.ts:680