Type-Safe Routing Without the Build Step

It always starts with a string. const { id } = useParams(). And right there, I'm already annoyed. What is id? It's a string. But my database says it's a number. So now I have to parse it. parseInt(id, 10). But wait, what if it's undefined? What if the user typed "banana" into the URL bar? Now I'm writing isNaN checks…