title: When using a setState function from useState as argument in useEffect why it is not required to write a callBack
body: <p>When I use a function from my component in the useEffect arguments as I understand I should write a callBack so it is memorized and used as dependency of the useEffect otherwise there is a warning, but when I use the setState of useState why there is no need to write a callback. Is it memorized by default? How does setState of useState work differently then a method in my component?</p>
  <pre><code>const [username, setUsername] = useState(undefined)
  const [password, setPassword] = useState(undefined)
  
  const onSuccessfulLogin  = useCallback((data, token) =&gt; {
      setUsername('')
      setPassword('')
      setUser(data)
      setAuth(token)
  },[setUsername, setPassword])
  
  useEffect(() =&gt; {
      onSuccessfulLogin()
  },[onSuccessfulLogin])
  </code></pre>