From e94d3679074f2652b0c410c8881ffade3afcca07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caner=20B=C3=BCy=C3=BCkduru?= <47858808+AizenSoftware@users.noreply.github.com> Date: Thu, 3 Oct 2024 16:00:34 +0300 Subject: [PATCH] Update AllProducts.jsx Using a tag inside another tag is not valid in HTML and can lead to unexpected behavior. In React Router, the component already functions as a navigation element, so there's no need to nest another or tag inside it. Nesting links can cause conflicts and result in incorrect rendering or functionality. Instead, simply use one tag to handle navigation. --- frontend/src/pages/Admin/AllProducts.jsx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/pages/Admin/AllProducts.jsx b/frontend/src/pages/Admin/AllProducts.jsx index c38b85ce..2756444d 100644 --- a/frontend/src/pages/Admin/AllProducts.jsx +++ b/frontend/src/pages/Admin/AllProducts.jsx @@ -1,4 +1,4 @@ -import { Link } from "react-router-dom"; +import { Link,useNavigate } from "react-router-dom"; import moment from "moment"; import { useAllProductsQuery } from "../../redux/api/productApiSlice"; import AdminMenu from "./AdminMenu"; @@ -24,10 +24,13 @@ const AllProducts = () => { {products.map((product) => ( - + navigate(`/admin/product/update/${product._id}`) + } > { - + ))}