-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Overlay components cannot be used as JSX components due to type errors #8092
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
Comments
What version of React Types are you on? you may need to update that. |
We're on @types/react 17.0.85, which I believe is the latest version of v17 (published 19 days ago). As for @react-types, I can repro with @react-types/[email protected] in addition to the other specified packages. We use |
I'm running into the same issue when trying to upgrade to react-aria-components 1.8.0, for several components that now return Upgrading @types/react from 18.2.0 to 18.2.79 did not solve the issue, likely because I'm still using typescript 4.8.4, and overriding |
I've opened a PR to explicitly go back to the types we implicitly had before, sorry for the disruption. #8099 |
Please upgrade your dependencies though 😉. React 17 is almost 5 years old. TypeScript 4.8 is almost 3. At some point compatibility with these will inevitably break. |
Provide a general summary of the issue here
I'm just upgrading to the latest version of react-aria now and I'm getting a number of type errors that appear to be related to this PR (I believe this commit is responsible).
🤔 Expected Behavior?
There should be no type errors when using
DismissButton
orOverlayProvider
components as JSX elements.😯 Current Behavior
There are type errors when using the
DismissButton
orOverlayProvider
components as a JSX elements💁 Possible Solution
The return types of at least some of the overlay components should probably be
ReactElement
and notReactNode
, sinceReactNode
is broader than required and prevents components from being used as JSX elements.I've highlighted
DismissButton
andOverlayProvider
because they're the errors I've encountered so far. I suspect there are more components than that with this issue.🔦 Context
No response
🖥️ Steps to Reproduce
@react-aria/overlays
version3.27.0
DismissButton
component, like belowWe're in the process of moving away from react 17, so our
@react-types@types/react version is currently 17.0.85Version
[email protected], but the relevant transitive dependency seems to be react-aria/[email protected]
What browsers are you seeing the problem on?
Other
If other, please specify.
No response
What operating system are you using?
macOS Sequoia Version 15.4
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: