usePolls
Introduction
The usePolls
hook is used to interact with the poll
type message object. You can use this to implement your custom UI for poll type conversations.
Property | Type | Description |
---|---|---|
submitPoll | ZeroArgVoidReturns | Function to submit the poll. |
addOptionOnPoll | ZeroArgVoidReturns | Function to add an option to the poll. |
getPollUsers | OneArgVoidReturns | Function to fetch users who interacted with the poll. |
selectPollOption | OneArgVoidReturns <React.MouseEvent<HTMLDivElement>> | Function to select a poll option. |
temporaryAddOptionText | string | Text value for a temporarily added poll option. |
setTemporaryAddOptionText | React.Dispatch<React.SetStateAction<string>> | Function to update the temporary poll option text. |
selectedPollOptions | SelectedPollOption[] | List of selected poll options. |
calculateAddPollOptionButtonVisibility | ZeroArgVoidReturns | Function to determine if the "Add Option" button should be shown. |
calculateSubmitButtonVisibility | ZeroArgVoidReturns | Function to determine if the "Submit" button should be shown. |
pollUsers | Member[] | List of users who interacted with the poll. |
SelectedPollOption
Property | Type | Description |
---|---|---|
id | string | Unique identifier of the poll option. |
Reference
For reference checkout this file