fix: cache with duplicated data
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { memo } from 'react'
|
||||
import classNames from 'clsx'
|
||||
import Link from 'next/link'
|
||||
import { useRouter } from 'next/router'
|
||||
@ -14,7 +15,7 @@ export interface ChannelProps {
|
||||
selected?: boolean
|
||||
}
|
||||
|
||||
export const Channel: React.FC<ChannelProps> = (props) => {
|
||||
const ChannelMemo: React.FC<ChannelProps> = (props) => {
|
||||
const { channel, path, selected = false } = props
|
||||
const router = useRouter()
|
||||
|
||||
@ -53,3 +54,5 @@ export const Channel: React.FC<ChannelProps> = (props) => {
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
export const Channel = memo(ChannelMemo)
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { memo } from 'react'
|
||||
import Image from 'next/image'
|
||||
|
||||
import { GuildWithDefaultChannelId } from '../../../models/Guild'
|
||||
@ -8,7 +9,7 @@ export interface GuildProps {
|
||||
selected?: boolean
|
||||
}
|
||||
|
||||
export const Guild: React.FC<GuildProps> = (props) => {
|
||||
const GuildMemo: React.FC<GuildProps> = (props) => {
|
||||
const { guild, selected } = props
|
||||
|
||||
return (
|
||||
@ -34,3 +35,5 @@ export const Guild: React.FC<GuildProps> = (props) => {
|
||||
</IconLink>
|
||||
)
|
||||
}
|
||||
|
||||
export const Guild = memo(GuildMemo)
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { memo } from 'react'
|
||||
import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
|
||||
@ -8,7 +9,7 @@ export interface MemberProps {
|
||||
member: MemberWithPublicUser
|
||||
}
|
||||
|
||||
export const Member: React.FC<MemberProps> = (props) => {
|
||||
const MemberMemo: React.FC<MemberProps> = (props) => {
|
||||
const { member } = props
|
||||
|
||||
return (
|
||||
@ -45,3 +46,5 @@ export const Member: React.FC<MemberProps> = (props) => {
|
||||
</Link>
|
||||
)
|
||||
}
|
||||
|
||||
export const Member = memo(MemberMemo)
|
||||
|
Reference in New Issue
Block a user