Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

use-latest

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-latest - npm Package Compare versions

Comparing version 1.2.1 to 1.3.0

dist/use-latest.cjs.d.mts

3

dist/declarations/src/index.d.ts

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

import * as React from 'react';
declare const useLatest: <T>(value: T) => React.MutableRefObject<T>;
declare const useLatest: <T>(value: T) => any;
export default useLatest;

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

export * from "./declarations/src/index";
export { default } from "./declarations/src/index";
export * from "./declarations/src/index.js";
export { default } from "./declarations/src/index.js";
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlLWxhdGVzdC5janMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4vZGVjbGFyYXRpb25zL3NyYy9pbmRleC5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBIn0=
'use strict';
if (process.env.NODE_ENV === "production") {
module.exports = require("./use-latest.cjs.prod.js");
} else {
module.exports = require("./use-latest.cjs.dev.js");
}
Object.defineProperty(exports, '__esModule', { value: true });
var React = require('react');
var useIsomorphicLayoutEffect = require('use-isomorphic-layout-effect');
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
var React__default = /*#__PURE__*/_interopDefault(React);
var useIsomorphicLayoutEffect__default = /*#__PURE__*/_interopDefault(useIsomorphicLayoutEffect);
var useLatest = function useLatest(value) {
var ref = React__default["default"].useRef(value);
useIsomorphicLayoutEffect__default["default"](function () {
ref.current = value;
});
return ref;
};
exports["default"] = useLatest;

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

import * as React from 'react';
import React from 'react';
import useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';

@@ -3,0 +3,0 @@

{
"name": "use-latest",
"version": "1.2.1",
"version": "1.3.0",
"description": "A React helper hook for storing latest value in ref object (updated in useEffect's callback).",
"main": "dist/use-latest.cjs.js",
"module": "dist/use-latest.esm.js",
"exports": {
".": {
"types": {
"import": "./dist/use-latest.cjs.mjs",
"default": "./dist/use-latest.cjs.js"
},
"module": "./dist/use-latest.esm.js",
"import": "./dist/use-latest.cjs.mjs",
"default": "./dist/use-latest.cjs.js"
},
"./package.json": "./package.json"
},
"files": [

@@ -28,3 +40,3 @@ "dist"

"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
},

@@ -40,3 +52,3 @@ "peerDependenciesMeta": {

"@babel/preset-typescript": "^7.16.7",
"@preconstruct/cli": "^2.1.5",
"@preconstruct/cli": "^2.8.10",
"@types/react": "^18.0.6",

@@ -48,3 +60,11 @@ "husky": "^4.2.5",

"typescript": "^4.6.3"
},
"preconstruct": {
"exports": {
"importConditionDefaultExport": "default"
},
"___experimentalFlags_WILL_CHANGE_IN_PATCH": {
"importsConditions": true
}
}
}
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