-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add "struct update" syntax to pass props to component (..props
instead of with props
)
#2024
Conversation
Visit the preview URL for this PR (updated for commit 79599d9): https://yew-rs--pr2024-add-double-dot-prop-hfiqz3dr.web.app (expires Mon, 13 Sep 2021 00:22:56 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
…w into add-double-dot-prop-syntax
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 really like this syntax over the previous and the extra effort to make it so that you can set properties at the same time as using this new syntax is really nice!
The restriction of using this syntax at the end of the component props list, to me, is not an issue at all - it's consistent with Rust's syntax and I personally think it reads better when you have it at the end :)
A few requested changes from me but nothing too major really.
I think the naming of this syntax is worthwhile getting pinned down and using consistently throughout the docs and error messages but see my comment below for more on that particular point.
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.
One span tweak and one Nit :)
Co-authored-by: mc1098 <[email protected]>
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.
One more round of tweaks and then I'm happy to approve this PR :D
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.
Looks good to me 🎉
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.
Looking good, just a few nits.
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.
Sorry for the conflicts 🙏. Should be g2g after they're resolved though.
Description
Update macros to use struct-update inspired syntax for props rather than
with
.Now, you can write the following:
Fixes #1636
Checklist
cargo make pr-flow