import { useState } from 'react';

const Page = () => {
  const [value, setValue] = useState(0);

  return (
    <Counter
      value={value}
      increase={() => setValue(value + 1)}
    />
  );
};

const Counter = (props) => {
  const { value, increase } = props;
  
  return (
    <div>
      <span>{value}</span>
      {' '}
      <button onClick={increase}>+1</button>
    </div>
  );
};

export default Page;
