-
-
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 failing test for with props
misuse
#664
Comments
@captain-yossarian not quite. The goal of this issue is to make sure that compiler error messages are helpful and we put those types of tests here. So a good place would be here: https://github.com/yewstack/yew/blob/master/tests/macro/html-component-fail.rs#L60 |
@captain-yossarian I just updated the issue description. It was a bit outdated and didn't call out html! {
<MyComponent with props value=1 />
} html! {
<MyComponent value=1 with props />
} And it would be great if the error message explained that the |
I have a problem with tests :( |
@jstarry @captain-yossarian Is this still an issue after #960 being merged? |
Nope it's fixed. thanks |
When rendering components with the
html!
macro,with props
can be used to simplify passing props to a component. This approach can not be used with the other approach of passing props one by one. We should have a test that fails when two approaches are combined to make sure the compile error message is nice!with props
approachlist props approach
not allowed
Note that there is an exception. Since
ref
is a special tag, it is still allowed in conjunction withwith props
. It must come afterwith props
though.The text was updated successfully, but these errors were encountered: