# Type alias Consumer<T>

Consumer<T>: ExoticComponent<ConsumerProps<T>>

The old way to read context, before useContext existed.

#### Type Parameters

- T

#### See

React Docs

#### Example

    import { UserContext } from './user-context';

    function Avatar() {
      return (
        <UserContext.Consumer>
          {user => <img src={user.profileImage} alt={user.name} />}
        </UserContext.Consumer>
      );
    }

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