Untitled
unknown
jsx
a year ago
730 B
15
Indexable
Never
import {View,Text,TextInput, StyleSheet,TouchableOpacity,Image,onPress} from "react-native" import {useState} from "react" export const Test = ()=>{ const [number,setnumber]=useState(0); const handleclick=()=>{ setnumber(number+1); } return( <View className="flex justify-center items-center h-[400px] w-full bg-slate-300"> <Text className="text-2xl text-white my-5">{number}</Text> <TouchableOpacity className="rounded-full bg-red-500 p-2 px-4 text-white" > <Text className="text-white" onPress={()=>handleclick()}>Click </Text> </TouchableOpacity> </View> ) };