Replace deprecated JSX namespace with direct import#5547
Replace deprecated JSX namespace with direct import#5547Efklaz wants to merge 3 commits intostyled-components:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 4921ae2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Has anyone else tested this change and confirmed it is necessary? |
|
I believe a simpler change is to upgrade the @types/react package to version 19. When doing this in some other projects, TypeScript infer the correct return type as React.JSX.Element. |
|
With this change I have another error: I tried to upgrade types/react to version 19 but then there are many issue with defaultProps that is also now removed from React 19, so I'm stuck at the moment :( |
|
i have a alternative solution for react 19 compatibility: #5578 |
|
The alternate fix was merged, so I will close this one. Thank you. |
The problem was that after the request (Replace deprecated global JSX namespace #4333), I couldn’t use styled-components in React 19. This happened because the .d.ts files were generated without using the React namespace in places where React.JSX was required. Instead, they were generated as plain JSX, which caused errors since, in React 19, this is no longer a global namespace but is scoped to React.