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.
react-infinite-any-height
Advanced tools
Wrapper component for react-infinite which auto calculates element heights.
react-infinite with automatic height calculation.
Try it - Live Example
npm install react-infinite-any-height
(peer dependencies: react
)
Check out Live Example, or run locally
git clone git@github.com:Radivarig/react-infinite-any-height.git
npm install
npm run dev
navigate to localhost:8080
// ...
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import InfiniteAnyHeight from 'react-infinite-any-height';
class App extends Component {
constructor() {
super();
const list = new Array(10000).fill('').map((x, i) => {
const height = 100 + Math.round(Math.abs((Math.sin(i) * 250)));
const style = { height, border: 'solid 1px', backgroundColor: `#${height}` };
return (
<div key={i} style={style}>
Height: { height + 2 }
<div style={{ textAlign: 'center', color: 'white' }}>
Item: {i}
</div>
</div>
);
});
this.state = { list };
}
render() {
return (
<InfiniteAnyHeight
list={this.state.list}
preloadAdditionalHeight={window.innerHeight*2}
useWindowAsScrollContainer
/>
);
}
}
var elemDiv = document.createElement('div')
document.body.appendChild(elemDiv)
ReactDOM.render(<App/>, elemDiv)
All props
are passed to react-infinite
as well.
When updating list
make sure to use .slice(0)
to change reference.
If useWindowAsScrollContainer
is ommited, both containerHeight
and
scrollContainer
(the node that has the active .scrollTop) props are required.
MIT
FAQs
Wrapper component for react-infinite which auto calculates element heights.
The npm package react-infinite-any-height receives a total of 917 weekly downloads. As such, react-infinite-any-height popularity was classified as not popular.
We found that react-infinite-any-height 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.
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.