Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor processing of attachment content types #62

Merged
merged 6 commits into from
Aug 24, 2023

Conversation

rygine
Copy link
Collaborator

@rygine rygine commented Aug 23, 2023

This PR updates the remote attachment message processor, removing the loading of the attachment. It doesn't make much sense to eagerly fetch this data until the message is being rendered. In addition, it's much harder to respond to errors when loading fails in the message processor.

To that end, this PR also adds a useAttachment hook that can be used to load remote data when rendering a message with ContentTypeRemoteAttachment. With this new hook, developers can now monitor loading state and respond to errors when loading the data.

@rygine rygine requested a review from a team August 23, 2023 18:34
@changeset-bot
Copy link

changeset-bot bot commented Aug 23, 2023

🦋 Changeset detected

Latest commit: 0da898c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@xmtp/react-sdk Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@rygine rygine requested a review from jhaaaa as a code owner August 23, 2023 18:37
@rygine rygine merged commit 0cbf18e into main Aug 24, 2023
4 checks passed
@rygine rygine deleted the rygine/attachments-update branch August 24, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants