-
Notifications
You must be signed in to change notification settings - Fork 40
Data fields should be added #89
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
Comments
Are you aware that you can work around this limitation, like this?
|
Ah, no I’m still a beginner in purescript, thanks for the hint. Though it may be good to have a mechanism for that kind of keys to avoid being obliged to use a workaround |
@immae I don't disagree with that point ;-) |
This might be possible, I'll give it a try |
I'm trying to use |
@spicydonuts Did you get around to this? Could you give an outline of your idea so that I or somebody else might try? |
What do you think of this approach? I used R.div { _data: fromHomogeneous { hmm: "something" } } <div data-hmm="something"></div> |
@spicydonuts : this looks good, thanks for the work! |
Nice, nice, nice, it works perfectly! How about taking a homogenous Record right away so it looks a bit prettier at use site? Also maybe |
The problem with taking records directly is the extra type variable for the fields. If you don't supply a record (all the fields are optional) the compiler can't infer what the type is supposed to be, which is an error. If we could tell the compiler it's fine to default to an empty record it would work.. Yeah, I thought about that. The quotes seemed kind of annoying, but it is nice that it reads like the end result. Also I already released it so it's probably not worth it to change it 😅 |
All html attributes support arbitrary attributes like "data-key", which are not currently in the SharedProps type. Would it be possible to add them, for instance as a
data :: Object String
which would translate todata-key = "values"
attributes?The text was updated successfully, but these errors were encountered: