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'
|
import useSidebarStyles from './style'
|
||||||
|
|
||||||
|
|
||||||
const { useState, useEffect } = React
|
const { useState, useEffect, useMemo } = React
|
||||||
|
|
||||||
type TSidebarContext = {
|
type TSidebarContext = {
|
||||||
isOpen: boolean,
|
isOpen: boolean,
|
||||||
|
@ -85,7 +85,7 @@ const Sidebar = ({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredSafes = filterBy(filter, safes)
|
const filteredSafes = useMemo(() => filterBy(filter, safes), [safes, filter])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SidebarContext.Provider value={{ isOpen, toggleSidebar }}>
|
<SidebarContext.Provider value={{ isOpen, toggleSidebar }}>
|
||||||
|
|
Loading…
Reference in New Issue