# MessageInput Hooks

Public `MessageInput` hooks:

## Best Practices

- Use hooks as the source of truth for composer and attachment state.
- Keep sendability checks (`useMessageComposerHasSendableData`) in one place.
- Treat attachment counts as derived state, not user-visible truth.
- Respect `useCooldownTimer` in custom inputs to avoid rate-limit issues.
- Avoid side effects inside hooks; trigger side effects in handlers instead.

### useMessageComposer

Retrieve the corresponding `MessageComposer` instance.

### useMessageComposerHasSendableData

Returns whether a message can be composed and sent. Useful for enabling/disabling the send button.

### useAttachmentManagerState

Returns an object with relevant data concerning attachments. The data carried by the object are:

- `attachments`
- `availableUploadSlots`
- `blockedUploadsCount`
- `failedUploadsCount`
- `isUploadEnabled`
- `pendingUploadsCount`
- `successfulUploadsCount`
- `uploadsInProgressCount`

### useCanCreatePoll

Returns whether a poll can be created. Useful for poll creation forms.

### useMessageInputControls

Contributes the following to `MessageInputContextValue`:

- `handleSubmit`
- `onPaste`
- `recordingController`
- `textareaRef`

### useCooldownTimer

A [custom hook](https://github.com/GetStream/stream-chat-react/blob/master/src/components/MessageInput/hooks/useCooldownTimer.tsx) that sets up the `CooldownTimer` and manages its state.


---

This page was last updated at 2026-04-21T07:55:45.206Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react/v13/hooks/message_input_hooks/](https://getstream.io/chat/docs/sdk/react/v13/hooks/message_input_hooks/).