From 808ffb0d515df9d7bd1ec10cc0ddccfa142e1a7f Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Tue, 26 Oct 2021 23:45:34 -0600 Subject: [PATCH] DashboardLinks: Fix time in links not being updated (#40934) (#40969) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit fadf72dd3400ae8d8dc2a848d3574940b9694844) Co-authored-by: Hugo Häggmark --- packages/grafana-ui/src/utils/useForceUpdate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/utils/useForceUpdate.ts b/packages/grafana-ui/src/utils/useForceUpdate.ts index e1e17230f44..6f9a08b8b9d 100644 --- a/packages/grafana-ui/src/utils/useForceUpdate.ts +++ b/packages/grafana-ui/src/utils/useForceUpdate.ts @@ -2,6 +2,6 @@ import { useState } from 'react'; /** @internal */ export function useForceUpdate() { - const [value, setValue] = useState(0); // integer state - return () => setValue(value + 1); // update the state to force render + const [_, setValue] = useState(0); // integer state + return () => setValue((prevState) => prevState + 1); // update the state to force render }