I think useState is used here to guarantee that the values are initialized once per component and remain stable across renders. I mean useMemo could work, but it might be recalculated, and it doesn’t really match "immutable state."