@@ -13,14 +13,45 @@ import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1313
1414import RNTesterText from '../../components/RNTesterText' ;
1515import * as React from 'react' ;
16- import { StyleSheet , View } from 'react-native' ;
16+ import {
17+ StyleSheet ,
18+ View ,
19+ Text ,
20+ TouchableWithoutFeedback ,
21+ TextInput ,
22+ } from 'react-native' ;
1723
1824function Playground ( ) {
25+ const [ value , setValue ] = React . useState ( '0.5' ) ;
26+ const [ scale , setScale ] = React . useState ( 0.5 ) ;
27+
1928 return (
20- < View style = { styles . container } >
21- < RNTesterText >
22- Edit "RNTesterPlayground.js" to change this file
23- </ RNTesterText >
29+ < View >
30+ < View style = { { backgroundColor : 'green' , marginTop : 10 } } >
31+ < View style = { { height : 100 , transform : [ { scaleY : 0 } ] } } >
32+ < TouchableWithoutFeedback onPress = { ( ) => console . log ( '1 clicked' ) } >
33+ < View style = { { flex : 1 , backgroundColor : 'red' } } />
34+ </ TouchableWithoutFeedback >
35+ </ View >
36+ </ View >
37+ < View style = { { backgroundColor : 'green' , marginTop : 10 } } >
38+ < View style = { { height : 100 , transform : [ { scaleY : scale } ] } } >
39+ < TouchableWithoutFeedback onPress = { ( ) => console . log ( '2 clicked' ) } >
40+ < View style = { { flex : 1 , backgroundColor : 'red' } } />
41+ </ TouchableWithoutFeedback >
42+ </ View >
43+ </ View >
44+ < View >
45+ < Text > Scale:</ Text >
46+ < TextInput
47+ value = { value }
48+ onChangeText = { it => {
49+ setValue ( it ) ;
50+ const p = parseFloat ( it ) ;
51+ if ( isFinite ( p ) ) setScale ( p ) ;
52+ } }
53+ />
54+ </ View >
2455 </ View >
2556 ) ;
2657}
0 commit comments