Poll

A component used to render a poll within a MessageList. Needs to be structured inside a Channel component.

It will render its default PollContent, which can be overridden for custom UI. Its children have access to the entire poll state through the usePollState hook.

Props

message

Message object.

Type
Message type

poll *

An instance of the Poll class containing reactive state.

It is used by the underlying usePollContext, usePollStateStore and usePollState hooks to provide us with the reactive Poll state.

If you need the Poll instance you may get it from client.polls.fromState(pollId).

Type
object

PollContent

A Component prop used to render the content of the Poll component in MessageList.

The component has full access to the entire Poll reactive state through the usePollState hook.

TypeDefault
ComponentTypePollContent

Props

PollHeader

A Component prop used to render the header of the PollContent component.

TypeDefault
ComponentTypePollHeader
PollButtons

A Component prop used to render the buttons of the PollContent component.

TypeDefault
ComponentTypePollButtons

© Getstream.io, Inc. All Rights Reserved.