# MessageTextContainer

Renders message text content inside [`MessageContent`](/chat/docs/sdk/react-native/ui-components/message-content/). It applies markdown rules, translation, and emoji-only styling.

## Best Practices

- Keep markdown customizations small and deterministic.
- Use `messageTextNumberOfLines` for overlay truncation behavior.
- Prefer `MessageText` override only when you need full text rendering control.
- Keep text press handlers lightweight.
- Use theme overrides for styling before replacing rendering logic.

## Props

| Prop                       | Description                                                                                                                                         | Type           |
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| `message`                  | Message object.                                                                                                                                     | `Message` type |
| `onLongPress`              | Default long press handler for message UI.                                                                                                          | `function`     |
| `onPress`                  | Default press handler for message UI.                                                                                                               | `function`     |
| `onlyEmojis`               | True if the message text contains only emojis.                                                                                                      | `boolean`      |
| `preventPress`             | Disable text press interactions.                                                                                                                    | `boolean`      |
| `markdownRules`            | Rules for [simple-markdown](https://github.com/Khan/simple-markdown#adding-a-simple-extension).                                                     | `object`       |
| `markdownStyles`           | Markdown style overrides for message text.                                                                                                          | `object`       |
| `messageOverlay`           | Whether the text is rendered in overlay mode.                                                                                                       | `boolean`      |
| `messageTextNumberOfLines` | Number of text lines to render in overlay mode.                                                                                                     | `number`       |
| `myMessageTheme`           | [Theme](/chat/docs/sdk/react-native/customization/theming/) applied to the current user's messages. Memoize this object or pass a stable reference. | `object`       |
| `styles`                   | Style overrides for internal text container wrapper.                                                                                                | `object`       |

## UI Component Props

### `MessageText`

Custom component used for message text rendering.

| Type          | Default                                                                                                                                           |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| ComponentType | [renderText](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/MessageItemView/utils/renderText.tsx) |


---

This page was last updated at 2026-04-17T17:33:45.713Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/ui-components/message-text-container/](https://getstream.io/chat/docs/sdk/react-native/ui-components/message-text-container/).