useState
引数はinitialStateだが、ここに関数を入れると遅延初期化される
ref
https://qiita.com/Takepepe/items/7e62cc7d7d8b81ca50db
アンチパターン
useStateの初期値に他のstateを渡すこともある
どういうとき?
どういう挙動になる?
ex.
ref
code:tsx
const
inputValue, setValue
= useState("reactjs");
const
subreddit, setSubreddit
= useState(inputValue);
https://zenn.dev/stin/articles/use-appropriate-api