Skip to content

Commit ea279f8

Browse files
Test
1 parent a2a72e2 commit ea279f8

2 files changed

Lines changed: 46 additions & 331 deletions

File tree

packages/rn-tester/js/RNTesterAppShared.js

Lines changed: 0 additions & 331 deletions
This file was deleted.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React, {useState} from 'react';
2+
import {Button, StyleSheet, View} from 'react-native';
3+
4+
const N = 20;
5+
6+
export default function Reproducer() {
7+
const [rotation, setRotation] = useState(0);
8+
9+
return (
10+
<View style={styles.container}>
11+
<Button
12+
title="Set rotation"
13+
onPress={() => setRotation(Math.random() * 2 * Math.PI)}
14+
/>
15+
{[...new Array(N)].map((_, i) => (
16+
<View key={i} style={styles.row}>
17+
{[...new Array(N)].map((__, j) => (
18+
<View
19+
key={j}
20+
style={[styles.box, {transform: [{rotate: `${rotation}rad`}]}]}
21+
/>
22+
))}
23+
</View>
24+
))}
25+
</View>
26+
);
27+
}
28+
29+
const styles = StyleSheet.create({
30+
container: {
31+
flex: 1,
32+
alignItems: 'center',
33+
justifyContent: 'center',
34+
},
35+
row: {
36+
flexDirection: 'row',
37+
justifyContent: 'center',
38+
},
39+
box: {
40+
backgroundColor: 'navy',
41+
width: 400 / N,
42+
height: 400 / N,
43+
marginRight: 1,
44+
marginBottom: 1,
45+
},
46+
});

0 commit comments

Comments
 (0)