Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Type strict useParams

Blue Mouse8d5bd579d5a8
diff --git a/app/hooks/useRequiredParams.ts b/app/hooks/useRequiredParams.ts
new file mode 100644
index 000000000..fcc87234c
--- /dev/null
+++ b/app/hooks/useRequiredParams.ts
@@ -0,0 +1,3 @@
+import { useParams } from '@remix-run/react'
+
+export const useRequiredParams = <T extends Record<string, unknown>>() => useParams() as T