import React, {useState} from 'react';
import { View, Button} from 'react-native';
function SayarButon({baslik, metod}){
return(
<Button title={baslik} onPress={metod}></Button>
);
}
export default function App(){
const [sayac, setSayac] = useState(0);
return(
<View>
<SayarButon baslik={"Bas: " + sayac} metod={()=>( setSayac(sayac + 1) )}/>
</View>
);
}
Hiç yorum yok:
Yorum Gönder