File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed
example/src/release_tests/gesturizedPressable Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 1+ import React from 'react' ;
2+ import { Pressable as LegacyPressable , StyleSheet , View } from 'react-native' ;
3+ import {
4+ Pressable as GesturizedPressable ,
5+ ScrollView ,
6+ } from 'react-native-gesture-handler' ;
7+ import { LoremIpsum } from '../../common' ;
8+
9+ export default function FlexExample ( ) {
10+ return (
11+ < ScrollView >
12+ < View style = { styles . container } >
13+ < GesturizedNesting />
14+ < LegacyNesting />
15+ </ View >
16+ < LoremIpsum words = { 40 } />
17+ </ ScrollView >
18+ ) ;
19+ }
20+
21+ function GesturizedNesting ( ) {
22+ return (
23+ < GesturizedPressable style = { styles . outer } >
24+ < GesturizedPressable style = { styles . inner } />
25+ </ GesturizedPressable >
26+ ) ;
27+ }
28+
29+ function LegacyNesting ( ) {
30+ return (
31+ < LegacyPressable style = { styles . outer } >
32+ < LegacyPressable style = { styles . inner } />
33+ </ LegacyPressable >
34+ ) ;
35+ }
36+
37+ const styles = StyleSheet . create ( {
38+ text : {
39+ padding : 10 ,
40+ } ,
41+ container : {
42+ flex : 1 ,
43+ flexDirection : 'row' ,
44+ justifyContent : 'center' ,
45+ gap : 50 ,
46+ } ,
47+ inner : {
48+ backgroundColor : 'green' ,
49+ width : 50 ,
50+ height : 50 ,
51+ } ,
52+ outer : {
53+ backgroundColor : 'red' ,
54+ width : 150 ,
55+ height : 150 ,
56+
57+ alignItems : 'center' ,
58+ justifyContent : 'center' ,
59+ } ,
60+ } ) ;
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { RippleExample } from './androidRippleExample';
88import { FunctionalStyleExample } from './functionalStylesExample' ;
99import { DelayedPressExample } from './delayedPressExample' ;
1010import { DelayHoverExample } from './hoverDelayExample' ;
11+ import FlexExample from './flexStyling' ;
1112
1213type TestingEntryProps = {
1314 title : string ;
@@ -64,6 +65,9 @@ export default function Example() {
6465 platform = "web" >
6566 < DelayHoverExample />
6667 </ TestingEntry >
68+ < TestingEntry title = "Flex behaviour of nested pressables" >
69+ < FlexExample />
70+ </ TestingEntry >
6771 </ ScrollView >
6872 ) ;
6973}
You can’t perform that action at this time.
0 commit comments