import { useContext } from "react";
import { ThemeContext } from "stream-chat-react-native";
const {
theme: {
colors: { accent_red },
},
} = useContext(OverlayContext);
ThemeContext
ThemeContext
is provided by OverlayProvider
and Chat
components.
Read the theming section for more information on how to customize your theme.
If you are not familiar with React Context API, please read about it on React docs.
Basic Usage
ThemeContext
can be consumed by any of the child component of OverlayProvider
or Chat
components.
Alternatively, you can also use useTheme
hook provided by library to consume ThemeContext.
import { useTheme } from "stream-chat-react-native";
const {
theme: {
colors: { accent_red },
},
} = useTheme();
Value
theme
The default theme object in theme.ts
merged with the theme you pass as style
to OverlayProvider
or Chat
components.
Type |
---|
object |
- I'm working with the Stream Chat React Native SDK and would like to ask questions about this documentation page: https://getstream.io/chat/docs/sdk/react-native/contexts/theme-context.md
- View as markdown
- Open in ChatGPT
- Open in Claude
On this page: