AppDev/20250312/my-app/app/Counter.tsx
2025-03-13 10:04:04 +01:00

19 lines
552 B
TypeScript

import React from "react";
import { View, Text, Button, StyleSheet } from "react-native";
import { CounterProvider, useCounter } from "./components/CounterContext";
const CounterScreen = () => {
const {count, increment, decrement} = useCounter();
return (
<View>
<Text>
Számláló: {count}
</Text>
<Button title="Növelés" onPress={increment}></Button>
<Button title="Csökkentés" onPress={decrement}></Button>
</View>
);
};
export default CounterScreen;