Replies: 2 comments 20 replies
I'm not 100% sure we should do it just because it breaks from what React does, but I quite like this idea. |
1 reply
Instead of using dataclasses, we'd probably use a |
19 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'd like to propose a class to facilitate a little bit the writing of component props, especially for those coming from ReactJS or HTML/JS. It should be basically a dict but with the benefit of code completion. Something like this:
Note, this would also simplify conditional prop supply. Maybe it could specialize to input and such using
Props[html.input]. Thechildrenprop is debatable.Furthermore (but this is not specific to this suggestion/class), 'data' and 'aria' props could optionally be dictionaries somewhat similar to 'style', and 'className' could accept a list, e.g.,
would become
{data_bs_toggle="collapse", class_name="btn btn-primary"}before being processed further.
With the pre-1.0.0 syntax, it'd work as follows:
and with the 1.0.0a3 syntax:
All reactions