#23 Fragment の key 修正
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import axios from 'axios'
|
||||
import toCamel from 'camelcase-keys'
|
||||
import { useState, useEffect } from 'react'
|
||||
import { Fragment, useState, useEffect } from 'react'
|
||||
import { Link, useLocation } from 'react-router-dom'
|
||||
|
||||
import Separator from '@/components/MenuSeparator'
|
||||
@@ -138,9 +138,8 @@ export default ({ user }: Props) => {
|
||||
'bg-yellow-200 dark:bg-red-975 items-start')}>
|
||||
<Separator />
|
||||
{menu.map ((item, i) => (
|
||||
<>
|
||||
<Link key={i}
|
||||
to={i === openItemIdx ? item.to : '#'}
|
||||
<Fragment key={i}>
|
||||
<Link to={i === openItemIdx ? item.to : '#'}
|
||||
className={cn ('w-full min-h-[40px] flex items-center pl-8',
|
||||
((i === openItemIdx)
|
||||
&& 'font-bold bg-yellow-50 dark:bg-red-950'))}
|
||||
@@ -163,7 +162,7 @@ export default ({ user }: Props) => {
|
||||
bg-yellow-50 dark:bg-red-950">
|
||||
{subItem.name}
|
||||
</Link>)))}
|
||||
</>))}
|
||||
</Fragment>))}
|
||||
<TopNavUser user={user} sp />
|
||||
<Separator />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user