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
The compiler will complain that my generic type F needs to implement PartialEq:
❯ cargo build
Compiling dx-props-fn v0.1.0 (<redacted>/dx-props-fn)
error[E0369]: binary operation `==` cannot be applied to type `&mut CompProps<F>`
--> src/main.rs:25:1
|
25 | #[component]
| ^^^^^^^^^^^^
|
= note: this error originates in the derive macro `Props` (in Nightly builds, run with -Z macro-backtrace for more info)
help: consider further restricting this bound
|
26 | fn Comp<F: Fn() + 'static + std::cmp::PartialEq>(function: F) -> Element {
| +++++++++++++++++++++
For more information about this error, try `rustc --explain E0369`.
error: could not compile `dx-props-fn` (bin "dx-props-fn") due to 1 previous error
What I would like to do: be able to provide custom logic via my components props.
I would like to pass closures (ideally) or functions as props.
Similar to: #1067 but the answer was specific to dioxus
0.3
, and since then, the migration guide indicates:The compiler complains that my generic type
F
needs to implementPartialEq
.And I am unsure how to proceed at this point.
Steps To Reproduce
Define the following component:
And use it like this inside the
Home
rsx!
The compiler will complain that my generic type
F
needs to implementPartialEq
:What I would like to do: be able to provide custom logic via my components props.
How would you proceed ?
Thanks for your time,
Best regards,
Environment:
relevant link for closures:
The text was updated successfully, but these errors were encountered: