eslint-plugin-react-hooks v7 warning for useVirtualizer: Compilation Skipped: Use of incompatible library
Los mantenedores suelen responder en 1 día
@kklem0 ya está trabajando en esto.
Desde el 25/7/2026.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- react, typescript
Línea de trabajo
Comienza con la reproducción proporcionada en StackBlitz, especialmente con src/main.tsx, eslint.config.ts y package.json, y ejecuta eslint con las versiones indicadas de los plugins de React y hooks. Compara el ejemplo de useVirtualizer con useWindowVirtualizer e inspecciona los puntos de entrada de la integración con React; se considera terminado cuando el caso reproducible de useVirtualizer ya no emite la advertencia de biblioteca incompatible sin suprimirla.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
I see warning
~/projects/kkvivbzvmm.github 1s
❯ eslint
Warning: React version not specified in eslint-plugin-react settings. See https://github.com/jsx-eslint/eslint-plugin-react#configuration .
/home/projects/kkvivbzvmm.github/src/main.tsx
14:23 warning Compilation Skipped: Use of incompatible library
This API returns functions which cannot be memoized without leading to stale UI. To prevent this, by default React Compiler will skip memoizing this component/hook. However, you may see issues if values from this API are passed to other components/hooks that are memoized.
/home/projects/kkvivbzvmm.github/src/main.tsx:14:23
12 | const listRef = React.useRef<HTMLDivElement | null>(null);
13 |
> 14 | const virtualizer = useVirtualizer({
| ^^^^^^^^^^^^^^ TanStack Virtual's `useVirtualizer()` API returns functions that cannot be memoized safely
15 | getScrollElement: () => window as any as Element,
16 | // const virtualizer = useWindowVirtualizer({
17 | count: 10000, react-hooks/incompatible-library
Your minimal, reproducible example
https://stackblitz.com/edit/tanstack-virtual-dvrcspge?file=eslint.config.ts
Steps to reproduce
import * as React from 'react';
import * as ReactDOM from 'react-dom/client';
import './index.css';
import {
useVirtualizer,
// useWindowVirtualizer
} from '@tanstack/react-virtual';
function Example() {
const listRef = React.useRef<HTMLDivElement | null>(null);
const virtualizer = useVirtualizer({
getScrollElement: () => window as any as Element,
// const virtualizer = useWindowVirtualizer({
count: 10000,
estimateSize: () => 35,
overscan: 5,
scrollMargin: listRef.current?.offsetTop ?? 0,
});
return (
<>
<div ref={listRef} className="List">
<div
style={{
height: `${virtualizer.getTotalSize()}px`,
width: '100%',
position: 'relative',
}}
>
{virtualizer.getVirtualItems().map((item) => (
<div
key={item.key}
className={item.index % 2 ? 'ListItemOdd' : 'ListItemEven'}
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: `${item.size}px`,
transform: `translateY(${
item.start - virtualizer.options.scrollMargin
}px)`,
}}
>
Row {item.index}
</div>
))}
</div>
</div>
</>
);
}
function App() {
return (
<div>
<p>
In many cases, when implementing a virtualizer with a window as the
scrolling element, developers often find the need to specify a
"scrollMargin." The scroll margin is a crucial setting that defines the
space or gap between the start of the page and the edges of the list.
</p>
<br />
<br />
<h3>Window scroller</h3>
<Example />
<br />
<br />
{process.env.NODE_ENV === 'development' ? (
<p>
<strong>Notice:</strong> You are currently running React in
development mode. Rendering performance will be slightly degraded
until this application is built for production.
</p>
) : null}
</div>
);
}
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
);
eslint.config.ts
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import { defineConfig } from 'eslint/config';
import reactHooks from 'eslint-plugin-react-hooks';
export default defineConfig([
{
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
plugins: { js },
extends: ['js/recommended'],
languageOptions: { globals: globals.browser },
},
tseslint.configs.recommended,
pluginReact.configs.flat.recommended,
reactHooks.configs.flat.recommended,
]);
package.json
"eslint": "^9.39.2",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
Expected behavior
no warning
tried "use no memo" - didnt work
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
chrome
tanstack-virtual version
^3.13.18
TypeScript version
No response
Additional context
No response
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- Lenguaje dominante
- TypeScript
- Estrellas
- 7.1k
- Forks
- 472
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de TanStack/virtual
-
measureElement caches 0 size for nodes that aren't attached yet (Vue: rows stack at start 0 and the list scrolls away on mount)Posiblemente ocupada @webn00b la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
`scrollToIndex(last, { align: 'end' })` stays short of the end after a measured row grows (virtual-core ≥ 3.17.0)Posiblemente ocupada @minwookshin la tomó hace 6 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
TanStack/virtual#1290 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
virtual-core: desktop Safari drops the prepend anchor write when history lands during the top rubber-band bouncePosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
marko-virtual: scrollToEnd during an in-flight prepend strands the view one prepend above the bottom (chat-pretext e2e fails on CI)Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 1 día
Todos los issues de TanStack/virtual
Issues similares
-
level/task reporter/qa type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
wazuh/wazuh-dashboard-plugins#9310 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cybersemics/treecrdt#267 ·
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 85/100
wiz-sec-public/backstage-plugin-wiz#16 · 1 comentario ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
solana-foundation/solana-com#2245 ·
Los mantenedores suelen responder en 1 día