diff --git a/docs/next/touchablehighlight.html b/docs/next/touchablehighlight.html index 8fa372c26bf..240e455d78b 100644 --- a/docs/next/touchablehighlight.html +++ b/docs/next/touchablehighlight.html @@ -84,7 +84,7 @@ underlayColor="#DDDDDD" onPress={() => alert('Pressed!')}> <MyComponent /> -</TouchableHighlight> +</TouchableHighlight>;
import React, { useState } from "react";
-import { StyleSheet, TouchableHighlight, Text, View } from "react-native";
+import { StyleSheet, Text, TouchableHighlight, View } from "react-native";
export default function TouchableHighlightExample() {
const [count, setCount] = useState(0);
-
- const onPress = () => {
- setCount(count + 1);
- };
+ const onPress = () => setCount(count + 1);
return (
<View style={styles.container}>
- <TouchableHighlight style={styles.button} onPress={onPress}>
- <Text> Touch Here </Text>
+ <TouchableHighlight onPress={onPress}>
+ <View style={styles.button}>
+ <Text>Touch Here</Text>
+ </View>
</TouchableHighlight>
-
<View style={styles.countContainer}>
- <Text style={styles.countText}>{count !== 0 ? count : null}</Text>
+ <Text style={styles.countText}>
+ {count ? count : null}
+ </Text>
</View>
</View>
);
@@ -143,7 +143,7 @@
import React, { Component } from "react";
-import { StyleSheet, TouchableHighlight, Text, View } from "react-native";
+import { StyleSheet, Text, TouchableHighlight, View } from "react-native";
export default class App extends Component {
constructor(props) {
@@ -174,12 +174,14 @@
render() {
return (
<View style={styles.container}>
- <TouchableHighlight style={styles.button} onPress={this.onPress}>
- <Text> Touch Here </Text>
+ <TouchableHighlight onPress={this.onPress}>
+ <View style={styles.button}>
+ <Text>Touch Here</Text>
+ </View>
</TouchableHighlight>
<View style={[styles.countContainer]}>
<Text style={[styles.countText]}>
- {this.state.count !== 0 ? this.state.count : null}
+ {this.state.count ? this.state.count : null}
</Text>
</View>
</View>
@@ -209,7 +211,7 @@
import React, { useState } from "react";
-import { StyleSheet, TouchableHighlight, Text, View } from "react-native";
+import { StyleSheet, Text, TouchableHighlight, View } from "react-native";
export default function TouchableHighlightExample() {
const [count, setCount] = useState(0);
-
- const onPress = () => {
- setCount(count + 1);
- };
+ const onPress = () => setCount(count + 1);
return (
<View style={styles.container}>
- <TouchableHighlight style={styles.button} onPress={onPress}>
- <Text> Touch Here </Text>
+ <TouchableHighlight onPress={onPress}>
+ <View style={styles.button}>
+ <Text>Touch Here</Text>
+ </View>
</TouchableHighlight>
-
<View style={styles.countContainer}>
- <Text style={styles.countText}>{count !== 0 ? count : null}</Text>
+ <Text style={styles.countText}>
+ {count ? count : null}
+ </Text>
</View>
</View>
);
@@ -143,7 +143,7 @@
import React, { Component } from "react";
-import { StyleSheet, TouchableHighlight, Text, View } from "react-native";
+import { StyleSheet, Text, TouchableHighlight, View } from "react-native";
export default class App extends Component {
constructor(props) {
@@ -174,12 +174,14 @@
render() {
return (
<View style={styles.container}>
- <TouchableHighlight style={styles.button} onPress={this.onPress}>
- <Text> Touch Here </Text>
+ <TouchableHighlight onPress={this.onPress}>
+ <View style={styles.button}>
+ <Text>Touch Here</Text>
+ </View>
</TouchableHighlight>
<View style={[styles.countContainer]}>
<Text style={[styles.countText]}>
- {this.state.count !== 0 ? this.state.count : null}
+ {this.state.count ? this.state.count : null}
</Text>
</View>
</View>
@@ -209,7 +211,7 @@