Am I using useState incorrectly here? - Theo's Typesafe Cult