mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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 ?? '');
|
||||
|
||||
Reference in New Issue
Block a user