Skip to content
Medium
Template literal types

Template literal routes

Type a router helper that only accepts /users/${id} routes. Show that other paths fail at compile time.

Starter provided. Feel free to modify.

Solution

Loading...
Run your code to see output and diagnostics.

Built by Antigravity. The source code is available on GitHub.