Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Title: Upgrade React Intersection Observer to React 19
Description
This pull request upgrades the react-intersection-observer library from React 17 to React 19. The upgrade involved several key changes:
Component Refactoring: Converted the IntersectionObserver component back to a class-based implementation to ensure compatibility with server-side rendering (SSR), which is not fully supported by functional components in React 19.
TypeScript Enhancements: Updated TypeScript configurations and type definitions to resolve compatibility issues and ensure type safety with the latest React and TypeScript versions.
Dependency Updates: Updated the package.json to reflect the latest versions of React, React DOM, and other dependencies, ensuring compatibility and leveraging new features.
Motivation and context
The upgrade to React 19 is crucial for maintaining compatibility with the latest React ecosystem. It addresses deprecated features, enhances performance, and prepares the library for future improvements. This change resolves existing compatibility issues and aligns the library with modern React practices.
How has this been tested?
The changes have been rigorously tested in a controlled development environment:
Unit Tests: Comprehensive unit tests were executed to verify the functionality of all components and ensure they behave as expected with React 19.
Integration Testing: The library was integrated into a sample application to test real-world scenarios and interactions.
Manual Testing: Extensive manual testing was conducted to ensure SSR compatibility and correct behavior of the Intersection Observer API across different browsers and environments.
Screenshots (if relevant):
N/A
Type of change
[x] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[x] My code follows the code style of this project
[x] My change requires a change to the documentation
[x] I have updated the documentation accordingly
[x] I have read the CONTRIBUTING document
[x] I have added tests to cover my changes
[x] All new and existing tests passed