UNPKG

@airplane/views

Version:

A React library for building Airplane views. Views components are optimized in style and functionality to produce internal apps that are easy to build and maintain.

15 lines (14 loc) 331 B
import { useRef } from "react"; let uniqueId = 0; const getUniqueId = () => uniqueId++; const useComponentId = (id) => { const idRef = useRef(); if (idRef.current === void 0) { idRef.current = `component-${getUniqueId()}`; } return id || idRef.current; }; export { useComponentId }; //# sourceMappingURL=useId.js.map