Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Wraps repeatedly rerendered components preserving their nodes in real DOM to reduce paints
Wraps repeatedly rerendered components preserving their nodes in real DOM to reduce paints. The idea is borrowed from Noscript framework, where box is a container for views that manages visibility of active views instead of taking irrelevant nodes out of DOM.
npm install react-box
Wrap your content into Box
element, and make sure that children of different classes have distinct keys:
render: function() {
var content;
if (this.props.mode === 'map') {
content = <Map key='map' />;
} else {
content = <Post key='post' id={ this.props.id } />
}
return <Box>{ content }</Box>;
}
This example will result in the following HTML structure:
<!-- Initial render: <Content mode='map' /> -->
<div>
<div style="display: block;">
<div class="map"><!-- … --></div>
</div>
</div>
<!-- First update: <Content mode='post' id='1' /> -->
<div>
<div style="display: none;">
<div class="map"><!-- … --></div>
</div>
<div style="display: block;">
<div class="post">
<h1>Post ID: 1</h1>
<!-- … -->
</div>
</div>
</div>
<!-- Second update: <Content mode='post' id='2' /> -->
<div>
<div style="display: none;">
<div class="map"><!-- … --></div>
</div>
<div style="display: none;">
<div class="post">
<h1>Post ID: 1</h1>
<!-- … -->
</div>
</div>
<div style="display: block;">
<div class="post">
<h1>Post ID: 2</h1>
<!-- … -->
</div>
</div>
</div>
<!-- Third update: <Content mode='post' id='2' /> -->
<div>
<div style="display: block;">
<div class="map"><!-- … --></div>
</div>
<div style="display: none;">
<div class="post">
<h1>Post ID: 1</h1>
<!-- … -->
</div>
</div>
<div style="display: none;">
<div class="post">
<h1>Post ID: 2</h1>
<!-- … -->
</div>
</div>
</div>
FAQs
Wraps repeatedly rerendered components preserving their nodes in real DOM to reduce paints
The npm package react-box receives a total of 5 weekly downloads. As such, react-box popularity was classified as not popular.
We found that react-box 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.