1 | ### bootstrap
|
2 | ```
|
3 | $ npm install
|
4 | $ react-native run-android
|
5 | $ react-native run-ios
|
6 | ```
|
7 |
|
8 | ### test
|
9 | ```
|
10 | npm test
|
11 | ```
|
12 |
|
13 | ### component style guide
|
14 | ```
|
15 | export default class MyComponent extends Compoent {
|
16 | static propTypes = {
|
17 | text: PropTypes.string
|
18 | };
|
19 |
|
20 | static defaultProps = {
|
21 | text: 'text'
|
22 | };
|
23 |
|
24 | state = {
|
25 | clickNumber: 0
|
26 | };
|
27 |
|
28 | animatedValue = new Animated.Value(0);
|
29 |
|
30 | componentDidMount() {
|
31 |
|
32 | }
|
33 |
|
34 | onPress = () => {
|
35 | this.setState((previousState) => {
|
36 | return {
|
37 | clickNumber: previousState.clickNumber + 1
|
38 | };
|
39 | });
|
40 | };
|
41 |
|
42 | render() {
|
43 | return (
|
44 | <View>
|
45 | <Text onPress={this.onPress}>{ this.props.text }</Text>
|
46 | </View>
|
47 | );
|
48 | }
|
49 | }
|
50 | ```
|