-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
Description
🐛 Bug Report
Hi folks 👋,
First of all, thanks for the massive work done on this project!
Back to the bug report: there's an issue with TypeScript's types for most of the components. It seems like React.forwardRef is the culprit here.
🤔 Expected Behavior
All the components should expose their types correctly - i.e. no any.
😯 Current Behavior
For example, the following View component - when imported - is inferred as any:
https://github.com/adobe/react-spectrum/blob/main/packages/%40react-spectrum/view/src/View.tsx#L45
Whereas a Button works totally fine:
💁 Possible Solution
Enforce proper types exposition (via aliasing).
🔦 Context
I encountered that while using React Spectrum in production project.
💻 Code Sample
Not relevant.
🌍 Your Environment
| Software | Version(s) |
|---|---|
| react-spectrum | 3.9.0 |
| typescript | 4.2.3 |
| Browser | not relevant |
| Operating System | not relevant |
🧢 Your Company/Team
Not relevant.
🕷 Tracking Issue (optional)
None.

