
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
@ndla/hooks
Advanced tools
Collection of React hooks used by NDLA
$ yarn @ndla/hooks
import { useRef } from "react";
import useComponentSize from "@ndla/component-size";
function MyComponent() {
let ref = useRef(null);
let size = useComponentSize(ref);
// size == { width: 100, height: 200 }
let { width, height } = size;
let imgUrl = `https://via.placeholder.com/${width}x${height}`;
return (
<div style={{ width: "100%", height: "100%" }}>
<img ref={ref} src={imgUrl} />
</div>
);
}
import useWindowSize from "@ndla/window-size";
function MyComponent() {
let windowSize = useWindowSize(100); // Optional throttle wait time (in ms)
// {
// innerWidth: window.innerWidth,
// innerHeight: window.innerHeight,
// outerWidth: window.outerWidth,
// outerHeight: window.outerHeight,
// }
return (
<div>
{windowSize.innerWidth < 768 ? (
<p>This document is less than 768px wide.</p>
) : (
<p>The document is at least 768px wide.</p>
)}
</div>
);
}
FAQs
Collection of React hooks used by NDLA
The npm package @ndla/hooks receives a total of 108 weekly downloads. As such, @ndla/hooks popularity was classified as not popular.
We found that @ndla/hooks demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.