Chore: Move useUniqueId to a general place (#69542)

* Move useUniqueId to a general place

* Use new built-in useId hook
This commit is contained in:
ismail simsek
2023-06-05 15:38:54 +03:00
committed by GitHub
parent 8914b8b96f
commit 97221595c1
8 changed files with 15 additions and 63 deletions

View File

@@ -1,5 +1,5 @@
import { css } from '@emotion/css';
import React, { useCallback } from 'react';
import React, { useCallback, useId } from 'react';
import { useAsync, useLocalStorage } from 'react-use';
import { GrafanaTheme2, toIconName } from '@grafana/data';
@@ -8,7 +8,6 @@ import { Card, Checkbox, CollapsableSection, Icon, Spinner, useStyles2 } from '@
import { config } from 'app/core/config';
import { t } from 'app/core/internationalization';
import { getSectionStorageKey } from 'app/features/search/utils';
import { useUniqueId } from 'app/plugins/datasource/influxdb/components/useUniqueId';
import { SearchItem } from '../..';
import { GENERAL_FOLDER_UID } from '../../constants';
@@ -91,7 +90,7 @@ export const FolderSection = ({
}
};
const id = useUniqueId();
const id = useId();
const labelId = `section-header-label-${id}`;
let icon = toIconName(section.icon ?? '');