import { StatusBar } from 'expo-status-bar'; import { useState } from 'react'; import { StyleSheet, Text, TouchableHighlight, View } from 'react-native'; import { TextInput } from 'react-native'; function calcTriangleArea(base, height) { return base * height / 2; } export default function App() { const [base, setBase] = useState(''); const [height, setHeight] = useState(''); const [area, setArea] = useState(''); function startCalc() { let result = calcTriangleArea(base, height); setArea(result); } return ( Triangle Háromszög területszámítás Alap setBase(base)} /> Magasság setHeight(height)} /> Számít Terület {area} ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: 'aqua', alignItems: 'center', justifyContent: 'center', }, button: { backgroundColor: 'blue', marginTop: 10, padding: 10, borderRadius: 3, }, butotnText: { color: 'white', paddingLeft: 10, paddingRight: 10, fontSize: 22, }, input: { backgroundColor: 'white', height: 30, } });