-
Notifications
You must be signed in to change notification settings - Fork 175
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
TypeScript types don't work with React 19 #304
Comments
Sounds like a worthwhile change. Do you think it’s backwards compatible or will we need to declare it twice? |
I'm honestly not sure, the React 19 upgrade guide makes it sound like it is not backwards-compatible, but I didn't try declaring it twice either (on 18 and 19) 😅 |
(sorry for the double notification, I messed up the config of the repo when I posted my first, now-deleted, comment) I made a repro repository and as far as I can tell, the fix is backwards compatible with React 18 / TypeScript 5.6 {
"dependencies": {
"@github/relative-time-element": "^4.4.5",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.3.18",
"globals": "^15.14.0",
"typescript": "~5.6.2",
}
} |
Fixes github#304 I had to add a `@ts-expect-error` comment since otherwise the typechecker would complain about missing `react` as a dependency.
I opened a PR, let me know what you think #305 |
Today I ran into an issue where the types that are shipped with the packages do not work anymore when using React 19 in a TypeScript project. This is because the global
JSX
namespace has been removed. I managed to fix the issue by making this change usingpatch-package
in my project.The text was updated successfully, but these errors were encountered: