From e39a80bc792c90cc8fe9f209964bbb34ca7f8e63 Mon Sep 17 00:00:00 2001 From: Dorian Niemiec Date: Tue, 10 Dec 2024 19:50:10 +0100 Subject: [PATCH] fix: replace the "use" hook with "useParams" hook in multi-log admin page --- app/(auth)/admin/multi-logs/[slug]/page.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/(auth)/admin/multi-logs/[slug]/page.tsx b/app/(auth)/admin/multi-logs/[slug]/page.tsx index e07d86d..3dfcbf5 100644 --- a/app/(auth)/admin/multi-logs/[slug]/page.tsx +++ b/app/(auth)/admin/multi-logs/[slug]/page.tsx @@ -1,6 +1,6 @@ "use client"; -import React, { useEffect, useState, use } from "react"; -import { useRouter } from "next/navigation"; +import React, { useEffect, useState } from "react"; +import { useParams, useRouter } from "next/navigation"; import dynamic from "next/dynamic"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; @@ -10,8 +10,8 @@ const MarkdownEditor = dynamic(() => import("@uiw/react-md-editor"), { ssr: false }); -const EditPage = (props: { params: Promise<{ slug: string }> }) => { - const params = use(props.params); +const EditPage = () => { + const params = useParams<{ slug: string }>() as { slug: string }; const router = useRouter(); const { slug } = params; const { toast } = useToast();