fix: add keys in TopNav

This commit is contained in:
p-sw 2024-06-01 21:00:47 +09:00
parent 10d4da7626
commit 210afb1b77

View File

@ -155,17 +155,25 @@ function TopNav() {
PSW/UI PSW/UI
</Link> </Link>
{RouteObject.mainNav.map((link) => { {RouteObject.mainNav.map((link) => {
return <Link to={link.path}>{link.name}</Link>; return (
<Link to={link.path} key={link.path}>
{link.name}
</Link>
);
})} })}
</div> </div>
{Object.entries(RouteObject.sideNav).map( {Object.entries(RouteObject.sideNav).map(
([categoryName, links]) => { ([categoryName, links]) => {
return ( return (
<div className="flex flex-col justify-start items-start gap-3"> <div
className="flex flex-col justify-start items-start gap-3"
key={categoryName}
>
<h2 className="font-bold">{categoryName}</h2> <h2 className="font-bold">{categoryName}</h2>
{links.map((link) => { {links.map((link) => {
return ( return (
<Link <Link
key={link.path}
to={link.path} to={link.path}
className="text-base opacity-75" className="text-base opacity-75"
> >