mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TopNav: Wrap TopSearchBar in memo to prevent unnecessary re-renders (#64667)
This commit is contained in:
parent
5ffb28989e
commit
5275a203aa
@ -19,7 +19,7 @@ import { TopSearchBarSection } from './TopBar/TopSearchBarSection';
|
||||
import { TopSearchBarCommandPaletteTrigger } from './TopSearchBarCommandPaletteTrigger';
|
||||
import { TOP_BAR_LEVEL_HEIGHT } from './types';
|
||||
|
||||
export function TopSearchBar() {
|
||||
export const TopSearchBar = React.memo(function TopSearchBar() {
|
||||
const styles = useStyles2(getStyles);
|
||||
const navIndex = useSelector((state) => state.navIndex);
|
||||
const location = useLocation();
|
||||
@ -67,7 +67,7 @@ export function TopSearchBar() {
|
||||
</TopSearchBarSection>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
const getStyles = (theme: GrafanaTheme2) => ({
|
||||
layout: css({
|
||||
|
Loading…
Reference in New Issue
Block a user