@progress/kendo-react-common
Version:
React Common package delivers common utilities that can be used with the KendoReact UI components. KendoReact Common Utilities package
36 lines (35 loc) • 939 B
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
"use client";
import * as t from "react";
import { guid as r } from "../guid.mjs";
import { useIsomorphicLayoutEffect as a } from "./use-isomorphic-layout-effect.mjs";
function I(e) {
const [u, c] = t.useState(!1);
t.useEffect(() => {
c(!0);
}, []);
const [s, f] = t.useState(() => {
if (e)
return e;
if (u)
return r();
});
a(() => {
s === void 0 && f(r());
}, []);
const o = t[`useId${r()}`.slice(0, 5)];
if (o !== void 0) {
const n = o();
return e != null ? e : n;
}
return s;
}
export {
I as useId
};