This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Expand file tree Collapse file tree 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ module Parens = {
2
+ type props<'id> = {key?: string, id?: 'id}
3
+ @react.component
4
+ let make = ({?id, _}: props<'id>) => {
5
+ ReactDOM.jsx(
6
+ "div",
7
+ {
8
+ id: ?{
9
+ let _ = ()
10
+ id->Option.map(x => x)
11
+ },
12
+ },
13
+ )
14
+ }
15
+ let make = {
16
+ let \"OptionalPropValue$Parens" = (props: props<_>) => make(props)
17
+ \"OptionalPropValue$Parens"
18
+ }
19
+ }
20
+
21
+ module WithoutParens = {
22
+ type props<'id> = {key?: string, id?: 'id}
23
+
24
+ @react.component
25
+ let make = ({?id, _}: props<'id>) => {
26
+ ReactDOM.jsx("div", {id: ?id->Option.map(x => x)})
27
+ }
28
+ let make = {
29
+ let \"OptionalPropValue$WithoutParens" = (props: props<_>) => make(props)
30
+ \"OptionalPropValue$WithoutParens"
31
+ }
32
+ }
Original file line number Diff line number Diff line change
1
+ module Parens = {
2
+ @react.component
3
+ let make = (~id = ?) => {
4
+ <div
5
+ id = ?{
6
+ let _ = ()
7
+ id -> Option .map (x => x )
8
+ }
9
+ />
10
+ }
11
+ }
12
+
13
+ module WithoutParens = {
14
+ @react.component
15
+ let make = (~id = ?) => {
16
+ <div id = ?{id -> Option .map (x => x )} />
17
+ }
18
+ }
You can’t perform that action at this time.
0 commit comments