perf: add React.memo to hot-path components
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import React from 'react'
|
||||
import AppBar from '@mui/material/AppBar'
|
||||
import Badge from '@mui/material/Badge'
|
||||
import Box from '@mui/material/Box'
|
||||
@@ -30,7 +31,7 @@ type NavItem = { label: string; to: string }
|
||||
|
||||
const navItems: NavItem[] = [{ label: 'Каталог', to: '/' }]
|
||||
|
||||
export function AppHeader() {
|
||||
export const AppHeader = React.memo(function AppHeader() {
|
||||
const { mode, resolvedMode, scheme, setScheme, cycleMode } = useThemeController()
|
||||
const user = useUnit($user)
|
||||
const navigate = useNavigate()
|
||||
|
||||
Reference in New Issue
Block a user