1+ /* eslint-disable react/jsx-no-bind */
12// https://github.com/kmagiera/react-native-gesture-handler/issues/320#issuecomment-443815828
23import 'react-native-gesture-handler' ;
34
@@ -71,8 +72,8 @@ const plugin = createPlugin({
7172 } ,
7273
7374 {
74- name : 'Modal ' ,
75- path : '/modal ' ,
75+ name : 'NativeStack ' ,
76+ path : '/native-stack ' ,
7677
7778 options : {
7879 headerShown : false ,
@@ -85,6 +86,61 @@ const plugin = createPlugin({
8586 type : 'native-stack' ,
8687 // mode: 'modal',
8788
89+ routes : [
90+ {
91+ name : 'Native 1' ,
92+ path : 'native1' ,
93+ exact : true ,
94+
95+ // eslint-disable-next-line react/display-name
96+ screen : ( props : any ) => (
97+ < ComponentState
98+ title = "Title 1"
99+ description = "This screen is in a native stack"
100+ actionOnPress = { ( ) => props . navigation . navigate ( 'Native2' ) }
101+ actionTitle = "Show Modal"
102+ />
103+ ) ,
104+
105+ navigationOptions : {
106+ // stackPresentation: 'modal',
107+ title : 'Native Stack 1 Screen' ,
108+ } ,
109+ } ,
110+ {
111+ name : 'Native2' ,
112+ path : 'native2' ,
113+ exact : true ,
114+
115+ // eslint-disable-next-line react/display-name
116+ screen : ( ) => (
117+ < ComponentState title = "Title 2" description = "This screen is in a modal" />
118+ ) ,
119+
120+ navigationOptions : {
121+ stackPresentation : 'modal' ,
122+ title : 'Native Stack 2 Screen' ,
123+ } as any ,
124+ } ,
125+ ] ,
126+ } ,
127+ } ,
128+
129+ {
130+ name : 'Modal' ,
131+ path : '/modal' ,
132+
133+ options : {
134+ headerShown : false ,
135+ contentStyle : {
136+ backgroundColor : 'black' ,
137+ } ,
138+ } ,
139+
140+ navigator : {
141+ type : 'stack' ,
142+ mode : 'modal' ,
143+
88144 routes : [
89145 {
90146 name : 'Modal1' ,
@@ -96,8 +152,8 @@ const plugin = createPlugin({
96152 < ComponentState
97153 title = "Title 1"
98154 description = "This screen is in a modal"
99- actionOnPress = { ( ) => props . navigation . navigate ( 'Modal2' ) }
100155 actionTitle = "Modal 2"
156+ actionOnPress = { ( ) => props . navigation . navigate ( 'Modal2' ) }
101157 />
102158 ) ,
103159
0 commit comments