Update the way to get params from the URL
This commit is contained in:
		
							parent
							
								
									f0bfa90140
								
							
						
					
					
						commit
						b6db72a5b7
					
				| @ -1,12 +1,15 @@ | |||||||
| /* Copyright (C) 2024 Manuel Bustillo*/ | /* Copyright (C) 2024 Manuel Bustillo*/ | ||||||
| 
 | 
 | ||||||
| 'use client'; | 'use client'; | ||||||
|  | 
 | ||||||
| import LoginForm from '@/app/ui/components/login-form'; | import LoginForm from '@/app/ui/components/login-form'; | ||||||
| import RegistrationForm from '@/app/ui/components/registration-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 ( |   return ( | ||||||
|     <main className="flex min-h-screen flex-col p-6"> |     <main className="flex min-h-screen flex-col p-6"> | ||||||
|       <div className="flex flex-row"> |       <div className="flex flex-row"> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user