Explore: Be sure time range key bindings are mounted after clear (#61892)

* Add list of bindings for updating on change

* Revert "Add list of bindings for updating on change"

This reverts commit 092707371d.

* Clear keybindings before component render
This commit is contained in:
Kristina
2023-01-24 11:12:09 -06:00
committed by GitHub
parent 3324be6fda
commit 6ab79c4fba

View File

@@ -1,4 +1,4 @@
import React, { Suspense, useEffect } from 'react';
import React, { Suspense, useEffect, useLayoutEffect } from 'react';
// @ts-ignore
import Drop from 'tether-drop';
@@ -18,9 +18,11 @@ export function GrafanaRoute(props: Props) {
chrome.setMatchedRoute(props.route);
useEffect(() => {
useLayoutEffect(() => {
keybindings.clearAndInitGlobalBindings();
}, [keybindings]);
useEffect(() => {
updateBodyClassNames(props.route);
cleanupDOM();
navigationLogger('GrafanaRoute', false, 'Mounted', props.match);