⚡ useState Nedir?


⚡ Temel Kullanım

import { useState } from "react";

function Counter() {
  const [count, setCount] = useState(0); // initialState = 0

  const increment = () => setCount(count + 1);

  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={increment}>Arttır</button>
    </div>
  );
}


⚡ Notlar