@radix-ui/react-id
Advanced tools
Comparing version 0.1.1 to 0.1.2-rc.1
@@ -1,7 +0,3 @@ | ||
import * as React from "react"; | ||
export const IdProvider: React.FC<{ | ||
children: React.ReactNode; | ||
}>; | ||
export function useId(deterministicId?: string): string; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,2 +0,2 @@ | ||
var e,r,n,t=require("@radix-ui/react-context").createContext,o=(e={},r=require("react"),Object.keys(r).forEach((function(n){"default"!==n&&"__esModule"!==n&&Object.defineProperty(e,n,{enumerable:!0,get:function(){return r[n]}})})),e),i=(n=require("@babel/runtime/helpers/extends"))&&n.__esModule?n.default:n;const d={prefix:Math.round(1e10*Math.random()),current:0},[u,a]=t("IdProvider",d);exports.IdProvider=e=>{const r=a("IdProvider"),n=r===d;/*#__PURE__*/return o.createElement(u,i({prefix:n?0:++r.prefix,current:0},e))},exports.useId=function(e){const r=a("IdProviderConsumer");return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||r!==d||console.warn("When server rendering, you must wrap your application in an <IdProvider> to ensure consistent ids are generated between the client and server."),o.useMemo((()=>e||`radix-id-${r.prefix}-${++r.current}`),[e])}; | ||
var e,t,r=require("@radix-ui/react-use-layout-effect").useLayoutEffect,u=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e);const n=u.useId||(()=>{});let c=0;exports.useId=function(e){const[t,a]=u.useState(n());return r((()=>{e||a((e=>null!=e?e:String(c++)))}),[e]),e||(t?`radix-${t}`:"")}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{createContext as e}from"@radix-ui/react-context";import*as r from"react";import o from"@babel/runtime/helpers/esm/extends";const n={prefix:Math.round(1e10*Math.random()),current:0},[t,i]=e("IdProvider",n);export const IdProvider=e=>{const d=i("IdProvider"),a=d===n;/*#__PURE__*/return r.createElement(t,o({prefix:a?0:++d.prefix,current:0},e))};export function useId(e){const o=i("IdProviderConsumer");return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||o!==n||console.warn("When server rendering, you must wrap your application in an <IdProvider> to ensure consistent ids are generated between the client and server."),r.useMemo((()=>e||`radix-id-${o.prefix}-${++o.current}`),[e])} | ||
import{useLayoutEffect as t}from"@radix-ui/react-use-layout-effect";import*as e from"react";const r=e.useId||(()=>{});let o=0;export function useId(u){const[a,i]=e.useState(r());return t((()=>{u||i((t=>null!=t?t:String(o++)))}),[u]),u||(a?`radix-${a}`:"")} | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-id", | ||
"version": "0.1.1", | ||
"version": "0.1.2-rc.1", | ||
"license": "MIT", | ||
@@ -31,4 +31,5 @@ "source": "src/index.ts", | ||
"@babel/runtime": "^7.13.10", | ||
"@radix-ui/react-context": "0.1.1" | ||
} | ||
"@radix-ui/react-use-layout-effect": "0.1.0" | ||
}, | ||
"stableVersion": "0.1.1" | ||
} |
Sorry, the diff of this file is not supported yet
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
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
5479
7
1
+ Added@radix-ui/react-use-layout-effect@0.1.0(transitive)
- Removed@radix-ui/react-context@0.1.1
- Removed@radix-ui/react-context@0.1.1(transitive)