import { useState } from 'react';
import CounterContext from './CounterContext';

const App: React.FC = () => {
  const [counter, setCounter] = useState(0);

  function increment() {
    setCounter((prevState) => prevState + 1);
  }

  return (
    <CounterContext value={counter}>
      <button onClick={increment}>increment</button>
    </CounterContext>
  );
};

export default App;

