Info:
This is documentation for Stream Chat React Native SDK v4, which is no longer actively maintained. For up-to-date documentation, see the latest version (v9).

OverlayContext

OverlayContext is provided by OverlayProvider component. If you are not familiar with React Context API, please read about it on React docs.

Basic Usage

OverlayContext can be consumed by any of the child component of OverlayProvider component as following:

import { useContext } from "react";
import { OverlayContext } from "stream-chat-react-native";

const { setOverlay } = useContext(OverlayContext);

Alternatively, you can also use useOverlayContext hook provided by library to consume OverlayContext.

import { useOverlayContext } from "stream-chat-react-native";

const { setOverlay } = useOverlayContext();

Value

overlay

Current active overlay. Overlay gets rendered in following cases

  • 'alert' - For delete message confirmation alert box
  • 'gallery' - When image viewer/gallery is opened
  • 'message' - When message overlay is opened by long pressing a message
  • 'none' - Default value
Type
enum('alert', 'gallery', 'message', 'none')

setOverlay

Setter for overlay. You can use this setter to show the overlay.

Type
(overlay) => void
Add Chat to my app: getstream.io/SKILL.md

The fastest way to build with Stream. Start a new project or improve an existing one. Full CLI and documentation integration out of the box.


Ask your agent:

/stream Build me a Social App with Feeds and Moderation.
/stream Any livestream calls running?
/stream Chat React Native v4: <Your Question>