How to make a custom hook that wraps useState with TypeScript properly