
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-auto-scroll-list
Advanced tools
react 列表滚动组件,在时间间隔内进行列表的高亮突出,到底自动滚动。
通过 npm
npm install react-auto-scroll-list --save
通过 yarn
yarn add react-auto-scroll-list
使用式例
import classnames from "classnames";
import ReactAutoScrollList from "react-auto-scroll-list";
import mockData from "./mockData";
import styles from "./App.module.less";
function App() {
return (
<ReactAutoScrollList<{ label: string; value: number }>
className={styles.container}
renderItem={(item, index, active) => {
const classNames = classnames(
styles.listItem,
active ? styles.active : styles.normal
);
return <div className={classNames}>{item.label}</div>;
}}
keyExtractor={(item, index) => `${index}`}
data={mockData}
timeInterval={1000}
/>
);
}
export default App;
参数 | 说明 | 类型 | 默认值 |
---|---|---|---|
className | 列表父容器 className | string | - |
renderItem | 列表渲染 | (item: T, index: number, isActive: boolean) => React. ReactElement; | |
keyExtractor | 列表 key | (item: T, index: number) => string | index |
data | 列表数据源 | T[] | - |
timeInterval | 列表状态切换间隔 | number | 1000ms |
FAQs
react 列表滚动组件,在时间间隔内进行列表的高亮突出,到底自动滚动。
We found that react-auto-scroll-list 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.