Context lets components pass information deep down without explicitly passing props.

Created from createContext

See

Example

import { createContext } from 'react';

const ThemeContext = createContext('light');
interface Context<T> {
    Consumer: Consumer<T>;
    Provider: Provider<T>;
    displayName?: string;
}

Type Parameters

  • T

Properties

Consumer: Consumer<T>
Provider: Provider<T>
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.

Generated using TypeDoc