We are introducing attachments to allow users to add files to their comments.
You can upgrade to 2.8 by downloading the latest version of each Liveblocks package you’re using. The easiest way to do that is to run the following command:
If you are not using Comments or are not using the default Comments components, there are no breaking changes for you! However, if you are, or intend to use them later, keep reading.
Liveblocks 2.8 adds attachments to Comments, and while not a breaking change, it is mostly enabled by default in the default components. We recommend you either enable attachments or disable attachments when you upgrade.
Attachments are enabled by default, but if you’re using
useCreateThread
,
useCreateComment
, or
useEditComment
, you can
now pass these an attachments array.
These hooks are most commonly used to enable
custom Composer behavior
with onComposerSubmit
, which now provides the attachments
array for you. You
must pass this to your mutations for attachments to work correctly.
Remember that this applies to
useCreateComment
and
useEditComment
too, not
just useCreateThread
.
No further changes are necessary to enable attachments in the default
components.
If you’d prefer to disable attachments, you can do so by setting the
showAttachments
prop to false
on each of the following components:
Composer
,
Comment
,
Thread
, and
InboxNotification
.
The default Composer
component’s structure has slightly changed, so if you customized its styles:
make sure to check if and how the new structure affects your changes.
We use cookies to collect data to improve your experience on our site. Read our Privacy Policy to learn more.