Skip to content

Commit 9205a27

Browse files
committed
fix: add GestureHandlerRootView to example app root
1 parent 76534a3 commit 9205a27

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

examples/App.tsx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import JavascriptClassExample from './example-src-files/javascript-class-example
55
import JavascriptFunctionExample from './example-src-files/javascript-function-example';
66
import TypescriptClassExample from './example-src-files/typescript-class-example';
77
import TypescriptFunctionExample from './example-src-files/typescript-function-example';
8+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
89

910
enum ExampleComponent {
1011
JavaScriptClassSingleValue,
@@ -130,31 +131,33 @@ export default class App extends React.Component<Props, State> {
130131
const { currentExample, examplePickerOpen, exampleComponents } = this.state;
131132

132133
return (
133-
<View style={styles.container}>
134-
<View style={{ flex: 1 }}>
134+
<GestureHandlerRootView style={{ flex: 1 }}>
135+
<View style={styles.container}>
135136
<View style={{ flex: 1 }}>
136-
<Text>Choose example:</Text>
137+
<View style={{ flex: 1 }}>
138+
<Text>Choose example:</Text>
139+
</View>
140+
141+
<View style={{ flex: 1 }}>
142+
<DropDownPicker
143+
setValue={this.setCurrentExample}
144+
value={currentExample}
145+
items={exampleComponents}
146+
open={examplePickerOpen}
147+
setOpen={this.setOpen}
148+
/>
149+
</View>
137150
</View>
138151

139-
<View style={{ flex: 1 }}>
140-
<DropDownPicker
141-
setValue={this.setCurrentExample}
142-
value={currentExample}
143-
items={exampleComponents}
144-
open={examplePickerOpen}
145-
setOpen={this.setOpen}
146-
/>
147-
</View>
148-
</View>
152+
<View style={{ flex: 3 }}>
153+
<View style={{ flex: 1 }}>
154+
<Text>Example:</Text>
155+
</View>
149156

150-
<View style={{ flex: 3 }}>
151-
<View style={{ flex: 1 }}>
152-
<Text>Example:</Text>
157+
{App.getExample(currentExample)}
153158
</View>
154-
155-
{App.getExample(currentExample)}
156159
</View>
157-
</View>
160+
</GestureHandlerRootView>
158161
);
159162
}
160163
}

0 commit comments

Comments
 (0)