Skip to content

Commit b323837

Browse files
committed
refactor: use proper react native components
1 parent fb603ce commit b323837

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

solutions/react-native-simple-counter.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
import React, { useState } from "react"
2-
import { Text, View, StyleSheet } from "react-native"
2+
import { Text, View, StyleSheet, Button } from "react-native"
33

44
const SimpleCounter = () => {
55
const [count, setCount] = useState(0)
66

77
const increment = () => setCount(count + 1)
8+
89
return (
910
<View style={styles.container}>
1011
<Text style={styles.counter}>
11-
button count: <span id="actualCount">{count}</span>
12+
button count: <Text id="actualCount">{count}</Text>
1213
</Text>
13-
<button id="mainButton" onClick={increment}>
14+
<Button id="mainButton" onPress={increment}>
1415
INCREASE
15-
</button>
16+
</Button>
1617
</View>
1718
)
1819
}

0 commit comments

Comments
 (0)