Socket
Socket
Sign inDemoInstall

@react-aria/ssr

Package Overview
Dependencies
Maintainers
1
Versions
742
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/ssr - npm Package Compare versions

Comparing version 3.0.0-nightly.2359 to 3.0.0

15

dist/main.js

@@ -30,12 +30,11 @@ var _react2 = require("react");

* When using SSR with React Aria, applications must be wrapped in an SSRProvider.
* This ensures that auto generated ids are consistent between the client and server
* by resetting the incremented value on each request.
* This ensures that auto generated ids are consistent between the client and server.
*/
function SSRProvider(props) {
let cur = useContext($e873f27652f6cc1e1ee5ebcb9b5e51$var$SSRContext);
let value = {
let value = useMemo(() => ({
// If this is the first SSRProvider, set to zero, otherwise increment.
prefix: cur === $e873f27652f6cc1e1ee5ebcb9b5e51$var$defaultContext ? 0 : cur.prefix + 1,
prefix: cur === $e873f27652f6cc1e1ee5ebcb9b5e51$var$defaultContext ? 0 : ++cur.prefix,
current: 0
};
}), [cur]);
return /*#__PURE__*/_react.createElement($e873f27652f6cc1e1ee5ebcb9b5e51$var$SSRContext.Provider, {

@@ -60,3 +59,7 @@ value: value

}
/** @private */
/**
* Returns whether the component is currently being server side rendered or
* hydrated on the client. Can be used to delay browser-specific rendering
* until after hydration.
*/

@@ -63,0 +66,0 @@

@@ -16,12 +16,11 @@ import _react, { useContext, useLayoutEffect, useMemo, useState } from "react";

* When using SSR with React Aria, applications must be wrapped in an SSRProvider.
* This ensures that auto generated ids are consistent between the client and server
* by resetting the incremented value on each request.
* This ensures that auto generated ids are consistent between the client and server.
*/
export function SSRProvider(props) {
let cur = useContext($f01a183cc7bdff77849e49ad26eb904$var$SSRContext);
let value = {
let value = useMemo(() => ({
// If this is the first SSRProvider, set to zero, otherwise increment.
prefix: cur === $f01a183cc7bdff77849e49ad26eb904$var$defaultContext ? 0 : cur.prefix + 1,
prefix: cur === $f01a183cc7bdff77849e49ad26eb904$var$defaultContext ? 0 : ++cur.prefix,
current: 0
};
}), [cur]);
return /*#__PURE__*/_react.createElement($f01a183cc7bdff77849e49ad26eb904$var$SSRContext.Provider, {

@@ -44,3 +43,7 @@ value: value

}
/** @private */
/**
* Returns whether the component is currently being server side rendered or
* hydrated on the client. Can be used to delay browser-specific rendering
* until after hydration.
*/

@@ -47,0 +50,0 @@ export function useIsSSR() {

10

dist/types.d.ts
import { ReactNode } from "react";
interface SSRProviderProps {
/** Your application here. */
children: ReactNode;

@@ -7,4 +8,3 @@ }

* When using SSR with React Aria, applications must be wrapped in an SSRProvider.
* This ensures that auto generated ids are consistent between the client and server
* by resetting the incremented value on each request.
* This ensures that auto generated ids are consistent between the client and server.
*/

@@ -14,5 +14,9 @@ export function SSRProvider(props: SSRProviderProps): JSX.Element;

export function useSSRSafeId(defaultId?: string): string;
/** @private */
/**
* Returns whether the component is currently being server side rendered or
* hydrated on the client. Can be used to delay browser-specific rendering
* until after hydration.
*/
export function useIsSSR(): boolean;
//# sourceMappingURL=types.d.ts.map
{
"name": "@react-aria/ssr",
"version": "3.0.0-nightly.2359+1ad0f163",
"version": "3.0.0",
"description": "Spectrum UI components in React",

@@ -28,3 +28,3 @@ "license": "Apache-2.0",

},
"gitHead": "1ad0f16354f7114e4ecfa5c75b16ec6f11ff1ec0"
"gitHead": "d050016e6876b20e4d8a95ba5fb5630d78e75a60"
}

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

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