Commit Graph

3 Commits

Author SHA1 Message Date
Rubén Norte e94852ff28 Modify IntersectionObserver example in RNTester to showcase changes in intersection due to changes in layout, instead of scroll (#44823)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44823

Changelog: [internal]

This modifies the example for `IntersectionObserver` in RNTester to test that the API reports changes in intersection also coming from changes in layout (previously is was only from changes in scroll position).

Reviewed By: javache

Differential Revision: D58260057

fbshipit-source-id: 305d5996148730d718da30896f6cc62991b717f7
2024-06-10 08:28:45 -07:00
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
Rubén Norte a94bbfbe0e Enable IntersectionObserver in Catalyst and RNTester (#37863)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/37863

This creates 2 examples for IntersectionObserver in RNTester:
* The first example is just a copy of the example provided by MDN in the documentation page for `IntersectionObserver` (https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API). This example is useful to show how React Native behaves the same way with the same code.
* The second example is a "stress test" for the API: a screen with 500 simultaneous node being observed at the same time with different observers. As we compute the intersections after scroll (after "mounting" the state update with the updated scroll position) in the main thread, this highlights a possible impact on scroll performance.

IntersectionObserver isn't yet enabled by default, so no need to add a changelog entry about this. We'll add one when the API becomes generally available.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D45736845

fbshipit-source-id: 40b6bce39f90e04653504b1033a4edfaa65e93ca
2023-06-23 02:56:04 -07:00