@radix-ui/react-id
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -1,2 +0,2 @@ | ||
var e,r,t,n=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e),o=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const u={prefix:Math.round(1e10*Math.random()),current:0},i=n.createContext(u);exports.IdProvider=e=>{const r=n.useContext(i),t=r===u,a=n.useMemo((()=>({prefix:t?0:++r.prefix,current:0})),[t,r]);return n.createElement(i.Provider,o({value:a},e))},exports.useId=function(e){const r=n.useContext(i);return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||r!==u||console.warn("When server rendering, you must wrap your application in an <IdProvider> to ensure consistent ids are generated between the client and server."),n.useMemo((()=>e||`radix-id-${r.prefix}-${++r.current}`),[e])}; | ||
var e,r,t,n=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e),o=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const u={prefix:Math.round(1e10*Math.random()),current:0},i=/*#__PURE__*/n.createContext(u);exports.IdProvider=e=>{const r=n.useContext(i),t=r===u,a=n.useMemo((()=>({prefix:t?0:++r.prefix,current:0})),[t,r]);/*#__PURE__*/return n.createElement(i.Provider,o({value:a},e))},exports.useId=function(e){const r=n.useContext(i);return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||r!==u||console.warn("When server rendering, you must wrap your application in an <IdProvider> to ensure consistent ids are generated between the client and server."),n.useMemo((()=>e||`radix-id-${r.prefix}-${++r.current}`),[e])}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import*as e from"react";import r from"@babel/runtime/helpers/esm/extends";const t={prefix:Math.round(1e10*Math.random()),current:0},n=e.createContext(t);export const IdProvider=o=>{const i=e.useContext(n),s=i===t,a=e.useMemo((()=>({prefix:s?0:++i.prefix,current:0})),[s,i]);return e.createElement(n.Provider,r({value:a},o))};export function useId(r){const o=e.useContext(n);return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||o!==t||console.warn("When server rendering, you must wrap your application in an <IdProvider> to ensure consistent ids are generated between the client and server."),e.useMemo((()=>r||`radix-id-${o.prefix}-${++o.current}`),[r])} | ||
import*as e from"react";import r from"@babel/runtime/helpers/esm/extends";const t={prefix:Math.round(1e10*Math.random()),current:0},n=/*#__PURE__*/e.createContext(t);export const IdProvider=o=>{const i=e.useContext(n),s=i===t,a=e.useMemo((()=>({prefix:s?0:++i.prefix,current:0})),[s,i]);/*#__PURE__*/return e.createElement(n.Provider,r({value:a},o))};export function useId(r){const o=e.useContext(n);return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||o!==t||console.warn("When server rendering, you must wrap your application in an <IdProvider> to ensure consistent ids are generated between the client and server."),e.useMemo((()=>r||`radix-id-${o.prefix}-${++o.current}`),[r])} | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-id", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "source": "src/index.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
9566
0