-
Notifications
You must be signed in to change notification settings - Fork 326
fix: require React 19 in peer dependencies #723
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
fix: require React 19 in peer dependencies #723
Conversation
|
|
@agcty don't merge it just yet, please. Also, can you please fix types in this PR? |
mattzcarey
left a comment
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.
blocking till ci passes :)
779ec8d to
addd209
Compare
|
@whoiskatrin Fixed and tested locally, CI should pass now! I also added @types/react assuming that's what you meant by "fix types", but the build passes without it too. Let me know if you'd like me to revert that part or if you meant something else! |
commit: |
The React hooks (`useAgent`, `useAgentChat`) use the `use()` hook which was introduced in React 19. The previous `"react": "*"` constraint was misleading since the code will not work with React 18 or earlier. This change makes the requirement explicit so consumers get a clear error during installation rather than a confusing runtime error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
addd209 to
eb5c6e4
Compare
Summary
Update the React peer dependency from
"*"(any version) to"^19.0.0".Problem
The React hooks (
useAgent,useAgentChat) use theuse()hook:The
use()hook was introduced in React 19 and doesn't exist in React 18 or earlier. The current"react": "*"constraint is misleading since consumers on React 18 will get a confusing runtime error:Solution
Change
"react": "*"to"react": "^19.0.0"in bothpeerDependenciesanddevDependencies. This makes the requirement explicit so consumers get a clear error during installation rather than at runtime.Breaking Changes
Consumers on React 18 will now see a peer dependency warning/error during installation. However, the code was already broken for them at runtime, so this just surfaces the issue earlier.
🤖 Generated with Claude Code