UNPKG

@coder/backstage-plugin-coder

Version:

Create and manage Coder workspaces from Backstage

16 lines (13 loc) 412 B
import React, { useState } from 'react'; let idCounter = 0; function useIdPolyfill() { const [readonlyId] = useState(() => { idCounter++; return `:r${idCounter}:`; }); return readonlyId; } const ReactWithNewerHooks = React; const useId = typeof ReactWithNewerHooks.useId === "undefined" ? useIdPolyfill : ReactWithNewerHooks.useId; export { useId }; //# sourceMappingURL=hookPolyfills.esm.js.map