File tree 4 files changed +63
-0
lines changed
4 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Primitive_option from "rescript/lib/es6/Primitive_option.js" ;
4
+ import * as JsxRuntime from "react/jsx-runtime" ;
5
+
6
+ function Jsx_optional_props_test$ComponentWithOptionalProps ( props ) {
7
+ return null ;
8
+ }
9
+
10
+ let ComponentWithOptionalProps = {
11
+ make : Jsx_optional_props_test$ComponentWithOptionalProps
12
+ } ;
13
+
14
+ let _element = JsxRuntime . jsx ( Jsx_optional_props_test$ComponentWithOptionalProps , {
15
+ i : 1 ,
16
+ s : "test" ,
17
+ element : Primitive_option . some ( JsxRuntime . jsx ( "div" , { } ) )
18
+ } ) ;
19
+
20
+ export {
21
+ ComponentWithOptionalProps ,
22
+ _element ,
23
+ }
24
+ /* _element Not a pure module */
Original file line number Diff line number Diff line change
1
+ @@config ({flags : ["-bs-jsx" , "4" ]})
2
+
3
+ module ComponentWithOptionalProps = {
4
+ @react.component
5
+ let make = (
6
+ ~i as _ : option <int >= ?,
7
+ ~s as _ : option <string >= ?,
8
+ ~element as _ : option <React .element >= ?,
9
+ ) => React .null
10
+ }
11
+
12
+ let _element = <ComponentWithOptionalProps i = 1 s = "test" element = {<div />} />
Original file line number Diff line number Diff line change @@ -190,6 +190,20 @@ let _large_component = <div
190
190
</ p >
191
191
</ div > ;
192
192
193
+ function Jsx_preserve_test$ComponentWithOptionalProps ( props ) {
194
+ return null ;
195
+ }
196
+
197
+ let ComponentWithOptionalProps = {
198
+ make : Jsx_preserve_test$ComponentWithOptionalProps
199
+ } ;
200
+
201
+ let _element = < Jsx_preserve_test$ComponentWithOptionalProps
202
+ i = { 1 }
203
+ s = "test"
204
+ element = { Primitive_option . some ( < div /> ) }
205
+ /> ;
206
+
193
207
export {
194
208
Icon ,
195
209
_single_element_child ,
@@ -213,5 +227,7 @@ export {
213
227
MyWeirdComponent ,
214
228
_escaped_jsx_prop ,
215
229
_large_component ,
230
+ ComponentWithOptionalProps ,
231
+ _element ,
216
232
}
217
233
/* _single_element_child Not a pure module */
Original file line number Diff line number Diff line change @@ -115,3 +115,14 @@ let _large_component =
115
115
</strong >
116
116
<p > {React .int (5 )} </p >
117
117
</div >
118
+
119
+ module ComponentWithOptionalProps = {
120
+ @react.component
121
+ let make = (
122
+ ~i as _ : option <int >= ?,
123
+ ~s as _ : option <string >= ?,
124
+ ~element as _ : option <React .element >= ?,
125
+ ) => React .null
126
+ }
127
+
128
+ let _element = <ComponentWithOptionalProps i = 1 s = "test" element = {<div />} />
You can’t perform that action at this time.
0 commit comments