-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Types broken in React@19
& Next@15
#5911
Comments
Thanks for the issue and the sample repo. The issue is actually with the Note that you are likely upgrading to React 19 and Next.js 15 too soon. Both of these are still RC/canary releases, so I would recommend waiting until a stable version is released and libraries have time to make any necessary updates. |
@Methuselah96 Thanks a ton! The second version of our app is in development and is due to release in a few month, so we are lucky to have time and ability to experiment with latest Next & React. |
Shouldn't a RC be suitable for libraries to start testing the upgrade? |
We should just be able to release it without it being an RC. The main blocker is that another maintainer needs to approve my PR before it can get merged. I want to be cautious about merging it since it could technically be considered a breaking change for TypeScript users since it requires a higher version of If you don't want to wait, as a workaround, you can add JSX to the global scope in your app: import * as React from 'react';
declare global {
namespace JSX {
interface Element extends React.JSX.Element {}
interface ElementClass extends React.JSX.ElementClass {}
interface ElementAttributesProperty extends React.JSX.ElementAttributesProperty {}
interface ElementChildrenAttribute extends React.JSX.ElementChildrenAttribute {}
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<C, P>;
interface IntrinsicAttributes extends React.JSX.IntrinsicAttributes {}
interface IntrinsicClassAttributes<T> extends React.JSX.IntrinsicClassAttributes<T> {}
interface IntrinsicElements extends React.JSX.IntrinsicElements {}
}
} or you can patch |
Issue
After migrating to
React@19
&Next@15
as well astypes-react@rc
&types-react-dom@rc
all type declarations forreact-select
seem to be broken.Reproduction
<Select />
in./src/app/page-content.tsx
npm run build
Extra info
My wild guess is that it might have something to do with React removing support for
defaultProps
andpropTypes
in v19. Or it might not...The text was updated successfully, but these errors were encountered: