Socket
Socket
Sign inDemoInstall

@radix-ui/react-id

Package Overview
Dependencies
Maintainers
6
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-id - npm Package Compare versions

Comparing version 0.1.6-rc.2 to 0.1.6-rc.3

52

dist/index.js

@@ -1,2 +0,52 @@

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".toString()]||(()=>{});let c=0;exports.useId=function(e){const[t,o]=u.useState(n());return r((()=>{e||o((e=>null!=e?e:String(c++)))}),[e]),e||(t?`radix-${t}`:"")},exports.IdProvider=function({children:e}){return u.useEffect((()=>{0}),[]),/*#__PURE__*/u.createElement(u.Fragment,null,e)};
var $47woD$react = require("react");
var $47woD$radixuireactuselayouteffect = require("@radix-ui/react-use-layout-effect");
function $parcel$exportWildcard(dest, source) {
Object.keys(source).forEach(function(key) {
if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
return;
}
Object.defineProperty(dest, key, {
enumerable: true,
get: function get() {
return source[key];
}
});
});
return dest;
}
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
var $dc478e4659f630c5$exports = {};
$parcel$export($dc478e4659f630c5$exports, "useId", () => $dc478e4659f630c5$export$f680877a34711e37);
$parcel$export($dc478e4659f630c5$exports, "IdProvider", () => $dc478e4659f630c5$export$6be90bcb437e928f);
const $dc478e4659f630c5$var$useReactId = $47woD$react['useId'.toString()] || (()=>undefined
);
let $dc478e4659f630c5$var$count = 0;
function $dc478e4659f630c5$export$f680877a34711e37(deterministicId) {
const [id, setId] = $47woD$react.useState($dc478e4659f630c5$var$useReactId()); // React versions older than 18 will have client-side ids only.
$47woD$radixuireactuselayouteffect.useLayoutEffect(()=>{
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($dc478e4659f630c5$var$count++)
);
}, [
deterministicId
]);
return deterministicId || (id ? `radix-${id}` : '');
} // DEPRECATED
function $dc478e4659f630c5$export$6be90bcb437e928f({ children: children }) {
$47woD$react.useEffect(()=>{}, []);
return /*#__PURE__*/ $47woD$react.createElement($47woD$react.Fragment, null, children);
}
const $dc478e4659f630c5$var$ID_PROVIDER_DEPRECATED = `Warning: The \`IdProvider\` has been deprecated. For details, see https://radix-ui.com/docs/primitives/utilities/id-provider`;
$parcel$exportWildcard(module.exports, $dc478e4659f630c5$exports);
//# sourceMappingURL=index.js.map

@@ -1,2 +0,36 @@

import{useLayoutEffect as t}from"@radix-ui/react-use-layout-effect";import*as e from"react";const r=e["useId".toString()]||(()=>{});let n=0;export function useId(o){const[u,i]=e.useState(r());return t((()=>{o||i((t=>null!=t?t:String(n++)))}),[o]),o||(u?`radix-${u}`:"")}export function IdProvider({children:t}){return e.useEffect((()=>{0}),[]),/*#__PURE__*/e.createElement(e.Fragment,null,t)}
import * as $2AODx$react from "react";
import {useLayoutEffect as $2AODx$useLayoutEffect} from "@radix-ui/react-use-layout-effect";
function $parcel$export(e, n, v, s) {
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
}
var $1746a345f3d73bb7$exports = {};
$parcel$export($1746a345f3d73bb7$exports, "useId", () => $1746a345f3d73bb7$export$f680877a34711e37);
$parcel$export($1746a345f3d73bb7$exports, "IdProvider", () => $1746a345f3d73bb7$export$6be90bcb437e928f);
const $1746a345f3d73bb7$var$useReactId = $2AODx$react['useId'.toString()] || (()=>undefined
);
let $1746a345f3d73bb7$var$count = 0;
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
const [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
$2AODx$useLayoutEffect(()=>{
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
);
}, [
deterministicId
]);
return deterministicId || (id ? `radix-${id}` : '');
} // DEPRECATED
function $1746a345f3d73bb7$export$6be90bcb437e928f({ children: children }) {
$2AODx$react.useEffect(()=>{}, []);
return /*#__PURE__*/ $2AODx$react.createElement($2AODx$react.Fragment, null, children);
}
const $1746a345f3d73bb7$var$ID_PROVIDER_DEPRECATED = `Warning: The \`IdProvider\` has been deprecated. For details, see https://radix-ui.com/docs/primitives/utilities/id-provider`;
export {$1746a345f3d73bb7$export$f680877a34711e37 as useId, $1746a345f3d73bb7$export$6be90bcb437e928f as IdProvider};
//# sourceMappingURL=index.module.js.map

4

package.json
{
"name": "@radix-ui/react-id",
"version": "0.1.6-rc.2",
"version": "0.1.6-rc.3",
"license": "MIT",

@@ -31,5 +31,5 @@ "source": "src/index.ts",

"@babel/runtime": "^7.13.10",
"@radix-ui/react-use-layout-effect": "0.1.1-rc.2"
"@radix-ui/react-use-layout-effect": "0.1.1-rc.3"
},
"stableVersion": "0.1.5"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc