Skip to content

Conversation

@nstepien
Copy link
Collaborator

@nstepien nstepien commented Feb 6, 2026

What if we used <Activity> to passively render the grid's content when it's not visible, or not yet measured?
https://react.dev/reference/react/Activity
Worth it? Not worth bothering? Just wanted to play with it at least.
We could also add a prop to let users pass their own mode to <Activity>.

@nstepien nstepien self-assigned this Feb 6, 2026
const [blockSize, setBlockSize] = useState(1);
const [horizontalScrollbarHeight, setHorizontalScrollbarHeight] = useState(0);
const [isMeasured, setIsMeasured] = useState(false);
const [isVisible, setIsVisible] = useState(true);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests break if I do not leave this initial state as true.
Should be fine once we move all our tests to use locators instead.

const { ResizeObserver } = window;
const { ResizeObserver, IntersectionObserver } = window;

// don't break in Node.js (SSR), jsdom, and browsers that don't support ResizeObserver
Copy link
Collaborator Author

@nstepien nstepien Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SSR environments do not run useLayoutEffect, not sure that part of the comment was ever applicable.

@codecov-commenter
Copy link

codecov-commenter commented Feb 6, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.71%. Comparing base (d7b1799) to head (ff55b55).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3949      +/-   ##
==========================================
+ Coverage   97.61%   97.71%   +0.09%     
==========================================
  Files          36       36              
  Lines        1470     1486      +16     
  Branches      477      478       +1     
==========================================
+ Hits         1435     1452      +17     
+ Misses         35       34       -1     
Files with missing lines Coverage Δ
src/DataGrid.tsx 98.99% <100.00%> (ø)
src/hooks/useGridDimensions.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nstepien nstepien marked this pull request as ready for review February 6, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants