-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add <Activity> #3949
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add <Activity> #3949
Conversation
| const [blockSize, setBlockSize] = useState(1); | ||
| const [horizontalScrollbarHeight, setHorizontalScrollbarHeight] = useState(0); | ||
| const [isMeasured, setIsMeasured] = useState(false); | ||
| const [isVisible, setIsVisible] = useState(true); |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
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
modeto<Activity>.