
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@seznam/compose-react-refs
Advanced tools
A simple utility for composing two or more react refs into a single callback ref.
A simple utility for composing two or more react refs (ref objects and callbacks are both supported and can be mixed) into a single callback ref. This enables you to effectively set multiple refs on the same component/element.
This utility does not use react hooks, therefore it can be used in class components (and even outside of react world) safely.
compose-react-refs is available as npm package, you can use npm to install
it:
npm install --save @seznam/compose-react-refs
The following example shows usage in a functional component that composes an
external ref with its own ref it uses to focus the renderer <input> element:
import * as React from 'react'
import composeRefs from '@seznam/compose-react-refs'
export default React.forwardRef((props, externalRef) => {
const myRef = React.useRef(null)
React.useEffect(() => {
myRef.current.focus()
})
return <input {...props} ref={composeRefs(myRef, externalRef)}/>
})
The refs will be updated in the order in which they were provided to the
composeRefs function.
FAQs
A simple utility for composing two or more react refs into a single callback ref.
The npm package @seznam/compose-react-refs receives a total of 439,153 weekly downloads. As such, @seznam/compose-react-refs popularity was classified as popular.
We found that @seznam/compose-react-refs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.