You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of writing, yew-autoprops does not support pattern-binding the props using the built-in @ operator (syntactically correct without the #[autoprops_component]):
expected `:`, found `@`
the trait bound `ExampleProps: Properties` is not satisfied
no field `example_prop` on type `ExampleProps`
Possible Solution
Handle pattern after the @ operator.
#[derive(PartialEq)]pubstructExampleProp{i:u64,}#[derive(PartialEq,Properties)]pubstructExampleProps{example_prop:ExampleProp,}#[function_component]pubfnExample(ExampleProps{// without the `example_prop @` the `example_prop` name will not be accessible in the function bodyexample_prop: example_prop @ ExampleProp{ i },}:&ExampleProps,) -> Html{html!{}}#[function_component]pubfnApp() -> Html{html!{
<Example example_prop={ExampleProp{ i: 0}} />
}}
The text was updated successfully, but these errors were encountered:
As of writing,
yew-autoprops
does not support pattern-binding the props using the built-in@
operator (syntactically correct without the#[autoprops_component]
):Errors:
Possible Solution
Handle pattern after the
@
operator.The text was updated successfully, but these errors were encountered: