From b8f8b879029049b8d4ba15a48ef32304e8f956af Mon Sep 17 00:00:00 2001 From: Oskar Nyberg Date: Thu, 25 Jan 2024 16:47:25 +0100 Subject: [PATCH] fixup! Add new settings row component for new style of rows --- gui/src/renderer/components/cell/SettingsGroup.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gui/src/renderer/components/cell/SettingsGroup.tsx b/gui/src/renderer/components/cell/SettingsGroup.tsx index 26debb335816..f430d96a3205 100644 --- a/gui/src/renderer/components/cell/SettingsGroup.tsx +++ b/gui/src/renderer/components/cell/SettingsGroup.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import React, { useCallback, useContext, useEffect, useId, useMemo, useState } from 'react'; import styled from 'styled-components'; import { colors } from '../../../config.json'; @@ -33,14 +33,9 @@ interface SettingsGroupContext { const settingsGroupContext = React.createContext({}); -let keyCounter = 0; -function getErrorKey() { - return ++keyCounter; -} - export function useSettingsGroupContext() { const { setError, unsetError } = useContext(settingsGroupContext); - const key = useMemo(() => `error-${getErrorKey()}`, []); + const key = useId(); const reportError = useCallback( (errorMessage: string) => {