Expanding props to accept functions #2845
bcpeinhardt
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
You could have a |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
Should yew components be able to accept a function as a prop (either a function pointer or an impl Fn situation)?
For context, as part of a larger project I've written a little procedural macro for deriving a form from a struct. Basically each member of the struct gets rendered as a form field and the user specifies a function that takes the struct as a parameter to be executed onsubmit (for instance to make an http request). I'd like the user to be able to pass the function as a prop, that way they can reuse the same form with a different onsubmit.
https://github.com/bcpeinhardt/formulaY
Beta Was this translation helpful? Give feedback.
All reactions