Better keys

This commit is contained in:
Lim Chee Aun 2023-11-06 23:50:49 +08:00
parent a8cf7879a2
commit a1b0d6e3bd

View file

@ -101,7 +101,7 @@ function Shortcuts() {
{formattedShortcuts.map( {formattedShortcuts.map(
({ id, path, title, subtitle, icon }, i) => { ({ id, path, title, subtitle, icon }, i) => {
return ( return (
<li key={i + title}> <li key={`${i}-${id}-${title}-${subtitle}-${path}`}>
<Link <Link
class={subtitle ? 'has-subtitle' : ''} class={subtitle ? 'has-subtitle' : ''}
to={path} to={path}
@ -170,9 +170,13 @@ function Shortcuts() {
</button> </button>
} }
> >
{formattedShortcuts.map(({ path, title, subtitle, icon }, i) => { {formattedShortcuts.map(({ id, path, title, subtitle, icon }, i) => {
return ( return (
<MenuLink to={path} key={i + title} class="glass-menu-item"> <MenuLink
to={path}
key={`${i}-${id}-${title}-${subtitle}-${path}`}
class="glass-menu-item"
>
<Icon icon={icon} size="l" />{' '} <Icon icon={icon} size="l" />{' '}
<span class="menu-grow"> <span class="menu-grow">
<span> <span>