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,8 +1,6 @@
|
||||
import React, { useRef, useState } from 'react';
|
||||
import React, { useId, useRef, useState } from 'react';
|
||||
import { useEffectOnce } from 'react-use';
|
||||
|
||||
import { useUniqueId } from 'app/plugins/datasource/influxdb/components/useUniqueId';
|
||||
|
||||
export interface Props {
|
||||
children: React.ReactNode | (({ isInView }: { isInView: boolean }) => React.ReactNode);
|
||||
width?: number;
|
||||
@@ -12,7 +10,7 @@ export interface Props {
|
||||
}
|
||||
|
||||
export function LazyLoader({ children, width, height, onLoad, onChange }: Props) {
|
||||
const id = useUniqueId();
|
||||
const id = useId();
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [isInView, setIsInView] = useState(false);
|
||||
const wrapperRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
Reference in New Issue
Block a user