generated at
useState
引数はinitialStateだが、ここに関数を入れると遅延初期化される ref




useStateの初期値に他のstateを渡すこともある
どういうとき?
どういう挙動になる?
ex. ref
tsx
const [inputValue, setValue] = useState("reactjs"); const [subreddit, setSubreddit] = useState(inputValue);


更新関数に関数を渡す