-
Notifications
You must be signed in to change notification settings - Fork 430
implement spread for jsx3 #1429
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
Conversation
|
Does this work with not just |
|
Supported: <Foo> ...bar </Foo>;
<Foo> ...((a) => 1) </Foo>;
<Foo> ...<div /> </Foo>;
<Foo> ...[|a|] </Foo>;
<Foo> ...(1, 2) </Foo>;Desugars to the following in the old syntax: Foo.createElement children::bar () [@JSX];
Foo.createElement children::(fun a => 1) () [@JSX];
Foo.createElement children::<div /> () [@JSX];
Foo.createElement children::[|a|] () [@JSX];
Foo.createElement children::(1, 2) () [@JSX];It **does not ** support: Should I add support for |
|
Ehhh good one, I think we should? What do you think? |
|
Yeah it would be weird to be inconsistent |
c27d697 to
cc9a49a
Compare
|
Added the <Navbar> ...[myList] </Navbar>;
(Navbar.createElement ~children:[myList] ())[@JSX]
<Navbar> myList </Navbar>;
(Navbar.createElement ~children:[myList] ())[@JSX]List syntax inside jsx children without spread operator |
|
Hah, that's troublesome now. Because from the react jsx ppx perspective, |
|
Non-idempotent formatting isn't great. If this is the only solution then I think we should just format |
|
Hmmm yeah are you sure |
33a3c2e to
03963bf
Compare
|
This wouldn't be "non-idempotent" as @IwanKaramazow described. I think it would be exactly what you would expect. |
03963bf to
1aa3c18
Compare
#1428
Is parsed as: