From b6db72a5b7d40cd80ac6bbba9c2456383c686bbc Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sat, 7 Dec 2024 22:59:36 +0100 Subject: [PATCH] Update the way to get params from the URL --- app/[slug]/page.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/app/[slug]/page.tsx b/app/[slug]/page.tsx index 00bd750..5f518f7 100644 --- a/app/[slug]/page.tsx +++ b/app/[slug]/page.tsx @@ -1,12 +1,15 @@ /* Copyright (C) 2024 Manuel Bustillo*/ -'use client'; +'use client'; + import LoginForm from '@/app/ui/components/login-form'; import RegistrationForm from '@/app/ui/components/registration-form'; +import { useParams } from 'next/navigation' -export default async function Page({ params }: { params: Promise<{ slug: string }> }) { +export default async function Page() { + const params = useParams<{ slug: string }>() + localStorage.setItem('slug', await params.slug); - localStorage.setItem('slug', (await params).slug) return (