We often face (or sometimes we need to implement) initialValue which sets the value only for the first time when it's rendered. (Fortunately, I had a chance to implement initialValue not so long ago).
A good example is formik.
const [types, setTypes] = useEffect(null);
const getTypes = useCallback(async () => {
const res = await getTypesAPI();
setTypes(res);
}, []);
return