mirror of
https://github.com/docmost/docmost.git
synced 2026-06-10 10:13:01 +08:00
ee3c5ce9d9
Track the scrollport element in state instead of reading `scrollportRef.current` during render. The ref was always null on the render that mounts the `.tableScrollport` div, so `useVirtualizer`'s `_willUpdate` saw `scrollElement=null`, skipped observer attachment, and `calculateRange` returned null — rendering zero rows even though the `/rows` response was already in the React-Query cache. The bug surfaced after a filter change (the `rowsLoading` skeleton path remounts the scrollport, and no follow-on render is guaranteed once `/rows` settles) but not on first base load (slower side queries forced an extra render that coincidentally re-bound the virtualizer). Switching views also masked it: the re-render triggered `_willUpdate` with a now- populated ref. Using a callback-ref-backed `useState` triggers a render the moment the div attaches, so the virtualizer picks it up on the next pass — no view-switch workaround needed.
React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptionsproperty like this:
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
- Replace
plugin:@typescript-eslint/recommendedtoplugin:@typescript-eslint/recommended-type-checkedorplugin:@typescript-eslint/strict-type-checked - Optionally add
plugin:@typescript-eslint/stylistic-type-checked - Install eslint-plugin-react and add
plugin:react/recommended&plugin:react/jsx-runtimeto theextendslist