I’ll have to give this a go.
I usually shared types from the backend to the front end in the same repo. Then change
(data: any)
To something like (data: User)
See this repo