Skip to content

Conversation

@jessetan
Copy link

@jessetan jessetan commented Aug 15, 2025

This PR upgrades react-headroom to be compatible with React 19 while maintaining backward compatibility with React 18. It also modernizes the entire dependency ecosystem and toolchain.

This was co-written with AI, but guided and tested with love and care by a real human.

As far as I can see, this is functionally equivalent to the current package, I have not updated the package version nor the README. The doc site was removed as it would be another migration.

I hope this PR will help others, even if it never gets merged.

Key Changes

React 19 Compatibility

  • Fixed defaultProps deprecation warning
  • Updated peerDependencies to support React ^18 || ^19
  • Removed PropTypes (no longer needed in modern React)

Dependency Modernization

  • Babel 6 → 7 ecosystem upgrade with modern presets and plugins
  • ESLint 3 → 9 with flat config system replacing legacy .eslintrc
  • Mocha and Chai updated to latest versions with ESM compatibility
  • Modern pre-commit hooks using @fastify/pre-commit
  • Replaced raf polyfill with native requestAnimationFrame (supported by modern browsers)

Breaking Changes

  • Minimum Node.js version may be higher due to modern dependencies
  • Removed support for React <18

Migration

Users on React 18+ can upgrade directly. For React <18, stay on the previous version.

The upgrade maintains all existing APIs and functionality while eliminating deprecation warnings and providing a modern development experience that is compatible with latest React.

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.

1 participant