New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lemur-react

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lemur-react - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

dist/src/useTargetHeight.d.ts

1

dist/index.d.ts

@@ -13,2 +13,3 @@ export * from './src/Display.js';

export * from './src/useNavigation.js';
export * from './src/useTargetHeight.js';
export * from './src/useTimeout.js';

@@ -15,0 +16,0 @@ export * from './src/useViewportRatio.js';

@@ -340,2 +340,26 @@ import { useMemo, useEffect, useState, useRef, useCallback } from "react";

}
const calculateTargetHeight = (node) => {
const assign = node;
const currentHeight = node.offsetHeight;
assign.style.height = "auto";
const targetHeight = node.offsetHeight;
assign.style.height = `${String(currentHeight)}px`;
return targetHeight;
};
function useTargetHeight(ref, active) {
const [targetHeight, setTargetHeight] = useState(0);
const updateTargetHeight = useCallback(() => {
if (ref.current) {
const newTargetHeight = calculateTargetHeight(ref.current);
setTargetHeight(newTargetHeight);
}
}, [ref]);
useEffect(() => {
if (active) {
updateTargetHeight();
}
return void 0;
}, [ref, updateTargetHeight, active]);
return { targetHeight, updateTargetHeight };
}
export {

@@ -354,2 +378,3 @@ Display,

useNavigation,
useTargetHeight,
useTimeout,

@@ -356,0 +381,0 @@ useViewportRatio,

2

package.json
{
"name": "lemur-react",
"version": "1.0.3",
"version": "1.0.4",
"private": false,

@@ -5,0 +5,0 @@ "description": "React utils based on unpublished work for the LemurCMS rewritten in Typescript",

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