add useMemo to sidebar
This commit is contained in:
parent
3b457d8647
commit
9ba01b3c56
|
@ -22,7 +22,7 @@ import LegalLinks from './LegalLinks'
|
|||
import useSidebarStyles from './style'
|
||||
|
||||
|
||||
const { useState, useEffect } = React
|
||||
const { useState, useEffect, useMemo } = React
|
||||
|
||||
type TSidebarContext = {
|
||||
isOpen: boolean,
|
||||
|
@ -85,7 +85,7 @@ const Sidebar = ({
|
|||
}
|
||||
}
|
||||
|
||||
const filteredSafes = filterBy(filter, safes)
|
||||
const filteredSafes = useMemo(() => filterBy(filter, safes), [safes, filter])
|
||||
|
||||
return (
|
||||
<SidebarContext.Provider value={{ isOpen, toggleSidebar }}>
|
||||
|
|
Loading…
Reference in New Issue