-
Notifications
You must be signed in to change notification settings - Fork 22
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
[composer] Made the value
prop reactive.
#93
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nylas/components/2w7oXy8uMDsxV5auB9dHuDYiNhk8 |
This pull request has been linked to Shortcut Story #66489: [components-composer] Make the value prop reactive. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess ideally we'd avoid having value be an object, but this looks good for now!
…y, so that is no longer supported. Pass a new object!
$: if (value) { | ||
mergeMessage(value); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the type of value
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Message | void
but I suppose it could be undefined
as well...
value
prop could only be set at instantiation of the composer component. This prevented users from being able to change its value dynamically via JS likeelement.value = { ...newValues }
.element.value.property = change
and expect any reactive changes. You must set a new object e.gelement.value = { property: change }
to trigger Svelte's reactive re-render. Tests have been updated to reflect this.License
I confirm that this contribution is made under the terms of the MIT license and that I have the authority necessary to make this contribution on behalf of its copyright owner.