fix: cache with duplicated data

This commit is contained in:
Divlo
2022-08-30 21:30:06 +02:00
parent 3d185bf044
commit a068d31d14
22 changed files with 98 additions and 95 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)