-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flattened prop syntax for parts of prop DSL #39
Comments
I am entirely familiar with the way the classes API is used within Mui but judging from the current vs. proposed snippets, I would definitely go for the latter ❤️ |
Hm, I'm having some trouble using I have this at the top of my components file: let reactElement (el: ReactElementType) (props: 'a) : ReactElement =
import "createElement" "react"
let createElement (el: ReactElementType) (properties: IReactProperty seq) : ReactElement =
reactElement el (createObj !!properties |> Flat.flat.unflatten)) This works fine for some prop lists, such as this: However, for others, such as this, it enters into an infinite recursion: I have no idea what's happening or how to fix it. Reported here: hughsk/flat#94 |
This comment has been minimized.
This comment has been minimized.
Flattened |
In the new theme creation DSL (#2) the theme props are defined in a flat list. This could be used for some component props as well.
Please let me know what you think.
To support this, I will have to run
unflatten
(from flat) for the props of every component, but according to @Zaid-Ajaj in #2 (comment) it shouldn't be a problem.It will also require some changes to the generator to support this for non-
classes
props. Not sure how significant these will be. But there seems to be only two such props anyway, so it might not be worth it (given limited time and resources).Candidates:
classes
and anything ending withClasses
(e.g.link.TypographyClasses
)Current:
Proposed:
popover.anchorOrigin
andpopover.transformOrigin
Current:
Proposed:
popover.anchorOrigin.horizontal 20 popover.anchorOrigin.vertical.center
The text was updated successfully, but these errors were encountered: