This is beta documentation for Stream Chat React Native SDK v9. For the latest stable version, see the latest version (v8)
.
MessageTextContainer
Renders message text content inside MessageContent. It applies markdown rules, translation, and emoji-only styling.
Best Practices
- Keep markdown customizations small and deterministic.
- Use
messageTextNumberOfLinesfor overlay truncation behavior. - Prefer
MessageTextoverride only when you need full text rendering control. - Keep text press handlers lightweight.
- Use theme overrides for styling before replacing rendering logic.
Props
message
Message object.
| Type |
|---|
Message type |
onLongPress
Default long press handler for message UI.
| Type |
|---|
| function |
onPress
Default press handler for message UI.
| Type |
|---|
| function |
onlyEmojis
True if the message text contains only emojis.
| Type |
|---|
| Boolean |
preventPress
Disable text press interactions.
| Type |
|---|
| boolean |
markdownRules
Rules for simple-markdown.
| Type |
|---|
| object |
markdownStyles
Markdown style overrides for message text.
| Type |
|---|
| object |
messageOverlay
Whether the text is rendered in overlay mode.
| Type |
|---|
| boolean |
messageTextNumberOfLines
Number of text lines to render in overlay mode.
| Type |
|---|
| number |
myMessageTheme
Theme applied to the current user’s messages.
| Type |
|---|
| object |
Memoize this object or pass a stable reference.
styles
Style overrides for internal text container wrapper.
| Type |
|---|
| object |
UI Component Props
MessageText
Custom component used for message text rendering.
| Type | Default |
|---|---|
| ComponentType | renderText |