forked from crowetic/commerce
Avoid unnecesary rerenders
This commit is contained in:
parent
2ad7c59c43
commit
817fee61cf
@ -5,12 +5,8 @@ import { Logo, Container } from '@components/ui'
|
|||||||
import { Searchbar, UserNav } from '@components/common'
|
import { Searchbar, UserNav } from '@components/common'
|
||||||
import cn from 'classnames'
|
import cn from 'classnames'
|
||||||
import throttle from 'lodash.throttle'
|
import throttle from 'lodash.throttle'
|
||||||
interface Props {
|
|
||||||
className?: string
|
|
||||||
}
|
|
||||||
|
|
||||||
const Navbar: FC<Props> = ({ className }) => {
|
const Navbar: FC = () => {
|
||||||
const rootClassName = className
|
|
||||||
const [hasScrolled, setHasScrolled] = useState(false)
|
const [hasScrolled, setHasScrolled] = useState(false)
|
||||||
|
|
||||||
const handleScroll = () => {
|
const handleScroll = () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user