Skip to content

[2.0.0-beta.0] 2020-10-14

Pre-release
Pre-release
Compare
Choose a tag to compare
@vishalnarkhede vishalnarkhede released this 15 Oct 11:33
· 2706 commits to master since this release

Upgrade

Please check Upgrade Docs for complete summary of upgrading from 0.x.x to 2.x.x

Changelog

BREAKING CHANGES

Typescript

This library has been moved to full typescript. Please check Typescript doc for details

Component prop changes

Channel

  • add additionalKeyboardAvoidingViewProps prop to allow custom keyboard props

ChannelListMessenger

  • remove setActiveChannel prop

ChannelPreviewMessenger

  • renamed the latestMessage prop to latestMessagePreview. This name change is more semantic to what the prop does and reduces confusion with the lastMessage prop

MessageContent

  • removed retrySendMessage prop in favor of retrySendMessage within MessagesContext

MessageInput

  • remove parent prop to parent_id as it needs to be just an id string instead of the entire parent object
  • add setInputRef prop to actually allow forwarding of the TextInput ref controls

MessageSystem

  • add formatDate prop to allow custom date formatting

ChannelContext

  • We have split the ChannelContext into three separate contexts to further modularize the code and reduce renders as items in context change. The following contexts now contain the following values, previously all held within the ChannelContext:

    • ChannelContext:

      • channel
      • disabled
      • EmptyStateIndicator
      • error
      • eventHistory
      • lastRead
      • loading
      • LoadingIndicator
      • markRead
      • members
      • read
      • setLastRead
      • typing
      • watcherCount
      • watchers
    • MessagesContext

      • Attachment
      • clearEditingState
      • editing
      • editMessage
      • emojiData
      • hasMore
      • loadingMore
      • loadMore
      • Message
      • messages
      • removeMessage
      • retrySendMessage
      • sendMessage
      • setEditingState
      • updateMessage
    • ThreadContext

      • closeThread
      • loadMoreThread
      • openThread
      • thread
      • threadHasMore
      • threadLoadingMore
      • threadMessages
  • All contexts are exported and any values can be accessed through a higher order component (ex: withMessagesContext) or with one of our custom context hooks (ex: access MessagesContext by const { messages } = useMessagesContext();).