import { useContext } from "react"
import { CounterContext } from "./CounterContext"


function Counter() {
    let { counter, setCounter } = useContext(CounterContext)
    return (
        <div>
            <h1>Számláló: {counter}</h1>
            <button onClick={() => {setCounter(counter + 1)}}>Növelés</button>
        </div>
    )
}


export default Counter