Why does react rerender this at the component level but not when using a hook? - Theo's Typesafe Cult