1
1
'use strict' ;
2
2
3
- var React = require ( "react" ) ;
4
3
var Js_dict = require ( "rescript/lib/js/js_dict.js" ) ;
5
4
var Caml_option = require ( "rescript/lib/js/caml_option.js" ) ;
6
5
var ReactNative = require ( "react-native" ) ;
6
+ var JsxRuntime = require ( "react/jsx-runtime" ) ;
7
7
var Stack$ReactNavigation = require ( "./Stack.bs.js" ) ;
8
8
var Native = require ( "@react-navigation/native" ) ;
9
9
10
10
function Example$HomeScreen ( props ) {
11
- return React . createElement ( ReactNative . Text , {
11
+ return JsxRuntime . jsx ( ReactNative . Text , {
12
12
children : "Hello Reasonable Person!"
13
13
} ) ;
14
14
}
@@ -18,7 +18,7 @@ var HomeScreen = {
18
18
} ;
19
19
20
20
function Example$ModalScreen ( props ) {
21
- return React . createElement ( ReactNative . Text , {
21
+ return JsxRuntime . jsx ( ReactNative . Text , {
22
22
children : "Hello From Modal"
23
23
} ) ;
24
24
}
@@ -34,15 +34,15 @@ var $$Navigator = include.$$Navigator;
34
34
var $$Screen = include . $$Screen ;
35
35
36
36
function Example$MainStackScreen ( props ) {
37
- return React . createElement ( $$Navigator . make , {
38
- children : Caml_option . some ( React . createElement ( $$Screen . make , {
37
+ return JsxRuntime . jsx ( $$Navigator . make , {
38
+ children : Caml_option . some ( JsxRuntime . jsx ( $$Screen . make , {
39
39
name : "Home" ,
40
40
options : ( function ( props ) {
41
41
var params = props . route . params ;
42
42
return {
43
43
title : params !== undefined ? Caml_option . valFromOption ( params ) . name : "Reason" ,
44
44
headerRight : ( function ( param ) {
45
- return React . createElement ( ReactNative . Button , {
45
+ return JsxRuntime . jsx ( ReactNative . Button , {
46
46
color : "#f00" ,
47
47
onPress : ( function ( param ) {
48
48
props . navigation . navigate ( "MyModal" ) ;
@@ -113,27 +113,30 @@ var linking = {
113
113
} ;
114
114
115
115
function Example$RootStackScreen ( props ) {
116
- return React . createElement ( Native . NavigationContainer , {
116
+ return JsxRuntime . jsx ( Native . NavigationContainer , {
117
117
linking : linking ,
118
- children : React . createElement ( $$Navigator$1 . make , {
118
+ children : JsxRuntime . jsxs ( $$Navigator$1 . make , {
119
119
screenOptions : ( function ( param ) {
120
120
return {
121
121
presentation : "modal"
122
122
} ;
123
123
} ) ,
124
- children : Caml_option . some ( null )
125
- } , React . createElement ( $$Screen$1 . make , {
126
- name : "Main" ,
127
- component : Example$MainStackScreen
128
- } ) , React . createElement ( $$Screen$1 . make , {
129
- name : "MyModal" ,
130
- children : ( function ( param ) {
131
- return React . createElement ( Example$ModalScreen , {
132
- navigation : param . navigation ,
133
- route : param . route
134
- } ) ;
124
+ children : [
125
+ JsxRuntime . jsx ( $$Screen$1 . make , {
126
+ name : "Main" ,
127
+ component : Example$MainStackScreen
128
+ } ) ,
129
+ JsxRuntime . jsx ( $$Screen$1 . make , {
130
+ name : "MyModal" ,
131
+ children : ( function ( param ) {
132
+ return JsxRuntime . jsx ( Example$ModalScreen , {
133
+ navigation : param . navigation ,
134
+ route : param . route
135
+ } ) ;
136
+ } )
135
137
} )
136
- } ) )
138
+ ]
139
+ } )
137
140
} ) ;
138
141
}
139
142
0 commit comments