Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import React, { useState } from "react";
import { Text, TouchableHighlight, View } from "react-native";
export default function MyClickableComponent() {
const [clicked, setClicked] = useState(false);
return (
onPress={() => setClicked(true)}
underlayColor="rgba(0, 0, 0, 0.3)"
<Text>{clicked ? "Click me" : "Clicked"}</Text>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.