
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
react-clone-referenced-element
Advanced tools
This is a version of React.cloneElement that preserves the original element's ref even if you specify a new ref for the clone.
Install this module from npm:
npm install --save react-clone-referenced-element
This library was designed for React Native, so if you are using it with React in other environments, you will need to compile the code first. How you do this is up to you. With Babel, use the following plugins:
You will also need to transform or define a global variable named __DEV__.
The signature of cloneReferencedElement is the same as that of React.cloneElement. However, when using callback refs, it will preserve the ref on the original component if there is one.
let element =
<Component ref={component => {
console.log('Running the original ref handler');
}} />
cloneReferencedElement(element, {
ref(component) {
console.log('Running the clone ref handler');
},
});
When the component is mounted, the console will display:
Running the clone ref handler
Running the original ref handler
FAQs
Clones a React element while preserving its original ref
The npm package react-clone-referenced-element receives a total of 94,652 weekly downloads. As such, react-clone-referenced-element popularity was classified as popular.
We found that react-clone-referenced-element demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.