Socket
Socket
Sign inDemoInstall

@radix-ui/react-id

Package Overview
Dependencies
Maintainers
5
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.0.1 to 0.0.2

2

dist/index.js

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

var e,r,n=(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);function t(){return(t=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e}).apply(this,arguments)}var o={prefix:Math.round(1e10*Math.random()),current:0},a=n.createContext(o);exports.IdProvider=function(e){var r=n.useContext(a),u=r===o,i=n.useMemo((function(){return{prefix:u?0:++r.prefix,current:0}}),[u,r]);return n.createElement(a.Provider,t({value:i},e))},exports.useId=function(e){var r=n.useContext(a);return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||r!==o||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((function(){return e||"radix-id-".concat(r.prefix,"-").concat(++r.current)}),[e])};
function e(e){return e&&e.__esModule?e.default:e}function r(e,r,n){Object.defineProperty(e,r,{get:n,enumerable:!0})}var n=require("react"),t=n.createContext,o=n.useContext,u=n.useMemo,i=n.createElement,a=e(require("@babel/runtime-corejs3/core-js-stable/instance/concat")),c=e(require("@babel/runtime-corejs3/helpers/extends"));require("core-js/modules/esnext.global-this.js");var s={},l={prefix:Math.round(1e10*Math.random()),current:0},d=t(l),f=function(e){var r=o(d),n=r===l,t=u((function(){return{prefix:n?0:++r.prefix,current:0}}),[n,r]);return i(d.Provider,c({value:t},e))};function v(e){var r=o(d);return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||r!==l||console.warn("When server rendering, you must wrap your application in an <IdProvider> to ensure consistent ids are generated between the client and server."),u((function(){var n;return e||a(n="radix-id-".concat(r.prefix,"-")).call(n,++r.current)}),[e])}exports.IdProvider=f,exports.useId=v,r(s,"useId",(function(){return v})),r(s,"IdProvider",(function(){return f}));
//# sourceMappingURL=index.js.map

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

import*as e from"react";function r(){return(r=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}const t={prefix:Math.round(1e10*Math.random()),current:0},n=e.createContext(t);export const IdProvider=o=>{const a=e.useContext(n),i=a===t,c=e.useMemo((()=>({prefix:i?0:++a.prefix,current:0})),[i,a]);return e.createElement(n.Provider,r({value:c},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-".concat(o.prefix,"-").concat(++o.current)),[r])}
function e(e,r,n){Object.defineProperty(e,r,{get:n,enumerable:!0})}import{createContext as r,useContext as n,useMemo as o,createElement as t}from"react";import i from"@babel/runtime-corejs3/core-js-stable/instance/concat";import a from"@babel/runtime-corejs3/helpers/esm/extends";import"core-js/modules/esnext.global-this.js";var u={},c={prefix:Math.round(1e10*Math.random()),current:0},s=r(c);export var IdProvider=function(e){var r=n(s),i=r===c,u=o((function(){return{prefix:i?0:++r.prefix,current:0}}),[i,r]);return t(s.Provider,a({value:u},e))};function d(e){var r=n(s);return Boolean(null===globalThis||void 0===globalThis?void 0:globalThis.document)||r!==c||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((function(){var n;return e||i(n="radix-id-".concat(r.prefix,"-")).call(n,++r.current)}),[e])}export{d as useId};e(u,"useId",(function(){return d})),e(u,"IdProvider",(function(){return IdProvider}));
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-id",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",

@@ -16,3 +16,4 @@ "source": "src/index.ts",

"clean": "rm -rf dist",
"prepublish": "yarn clean"
"prepublish": "yarn clean",
"version": "yarn version"
},

@@ -29,3 +30,6 @@ "peerDependencies": {

"url": "https://github.com/radix-ui/primitives/issues"
},
"dependencies": {
"@babel/runtime-corejs3": "^7.13.10"
}
}

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