Interface Context<T>

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

Created from createContext

See

Example

import { createContext } from 'react';

const ThemeContext = createContext('light');

Type Parameters

  • T

Hierarchy

  • Context

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.

See

Legacy React Docs

Generated using TypeDoc