MessageInput Hooks
Publicly available The MessageInput
component hooks are the following:
useMessageComposer
Retrieve the corresponding MessageComposer
instance.
useMessageComposerHasSendableData
Returns a boolean value signaling whether a message can be composed and sent. The value is automatically updated. Useful for send button enablement.
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 a boolean value signaling whether a message can be composed and created. Useful for poll creation forms.
useMessageInputControls
A hook that contributes to the MessageInputContextValue
with the following:
handleSubmit
onPaste
recordingController
textareaRef
useCooldownTimer
A custom hook where the CooldownTimer
component is established. Handles the state logic for the timer and returns this data and the related handler.