Files
react-native-chat-ui/docs/props.md
Alex Demchenko e90047512e Add docs
2021-03-24 00:00:44 +01:00

5.8 KiB

id, title
id title
props Props

:::note

Question mark shows optional types.

:::

Name Type Description
dateDividerFormat? string Date format used for dividers
flatListProps? FlatListProps<MessageType.Any[]> Main flat list props
inputProps? InputAdditionalProps Additional props for the components that are on the bottom bar
isAttachmentUploading? boolean If true, shows spinner instead of attachment button, useful to show while something is being uploaded
l10nOverride? ... See localization
locale? ... See localization
messages MessageType.Any[] Messages array
messageTimeFormat? string Time format under messages
onAttachmentPress? () => void Called when attachment button is pressed
onFilePress? (message: MessageType.File) => void Called when user taps on a file message
onPreviewDataFetched? ({ message, previewData }: { message: MessageType.Text; previewData: PreviewData }) => void Called when a link that is found in the text is unwrapped in a rich preview. Use it to save the data.
onSendPress (message: MessageType.PartialText) => void Called when send button is pressed, use message parameter to create a text message
renderFileMessage? (message: MessageType.File, messageWidth: number) => React.ReactNode Render prop for the file message
renderImageMessage? (message: MessageType.Image, messageWidth: number) => React.ReactNode Render prop for the image message
renderTextMessage? (message: MessageType.Text, messageWidth: number) => React.ReactNode Render prop for the text message
textInputProps? TextInputProps Main input props
theme? ... See themes
user User Current logged in user, used to determine the message author

InputAdditionalProps

Name Type Description
attachmentButtonProps? AttachmentButtonAdditionalProps Additional props for the attachment button
attachmentCircularActivityIndicatorProps? CircularActivityIndicatorProps Spinner props (see isAttachmentUploading)

AttachmentButtonAdditionalProps

Name Type Description
touchableOpacityProps? TouchableOpacityProps Attachment button's touchable props

CircularActivityIndicatorProps

Name Type Description
color ColorValue Spinner's color
size? number Spinner's size
style? StyleProp<ViewStyle> Spinner's container styles