I\'m gradually adding Typescript to an Nextjs app but I\'ve hit an issue. In the map function Typescript works as expected if I write the type checks inline but not if I use an