Generic Components Expect Confusing Types #605
scottbot95
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
#385 added support for generic components, however when using
rsx!
to actually create a generic component, the type you pass as the generic parameter is the props type, not the "actual" generic argument of the component function. IEExpected behavior
I understand from a technical perspective it is simpler to just accept the props type directly in
rsx!
since one of the primary purposes of that macro is to create the props struct, however that behavior is confusing and unintuitive. It would be substantially more user-friendly and require less boilerplate if the generic args passed inrsx!
simply matched the generic args to the component function itself.Beta Was this translation helpful? Give feedback.
All reactions