-
-
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
Fixed NodeRef
not being implicitly cloned with components
#2775
Fixed NodeRef
not being implicitly cloned with components
#2775
Conversation
Visit the preview URL for this PR (updated for commit cb29913): https://yew-rs-api--pr2775-noderef-implicitclon-9fzorf8n.web.app (expires Wed, 13 Jul 2022 15:38:15 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Size Comparison
✅ None of the examples has changed their size significantly. |
As discussed with @WorldSEnder on discord, I've moved the code to |
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.
This has tests, does what it advertises and cleans up inconsistencies (even removing lines overall). 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.
Looks good to me. Until #2505 is resolved, this is a nice improvement
Description
Passing a
&NodeRef
to a html componentref
attribute would throw an error whereas with a html element it wouldn't.A html component didn't use
IntoPropValue
on theref
attribute and thus didn't useImplicitClone
.I've made
packages/yew-macro/src/html_tree/html_component.rs
more inline with how the
ref
andkey
attributes are implemented inpackages/yew-macro/src/html_tree/html_element.rs
To make subtle differences between the implementations clearer (e.g. notice the missing
optimize_literals()
on the key value before)Checklist