@dark-engine/core
Version:
The lightweight and powerful UI rendering engine without dependencies and written in TypeScript (Browser, Node.js, Android, iOS, Windows, Linux, macOS)
11 lines (10 loc) • 315 B
JavaScript
import { useMemo } from '../use-memo';
import { getRootId } from '../scope';
function useId() {
const id = useMemo(() => getNextId(getRootId()), []);
return id;
}
let nextId = 1000000;
const getNextId = rootId => `dark:${rootId}:${(++nextId).toString(36)}`;
export { useId };
//# sourceMappingURL=use-id.js.map