Typescript #5021
-
I am wondering is there a full example of working typescript I keep bumping into type issues that seems to convoluted to fix and most working examples and docs doesn't fully document the types or even worse, the running examples are from a previous version that doesn't match to the latest Would love to have this implemented but now its just too difficult and I am not comfortable in using |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 17 replies
-
Do you have a specific issue that you're running into? All of our examples on our docs have as much TS as they need in order to be functional. It is definitely minimal and we do have a goal to expand them. #865 Can you point to an example that is running on a previous version? |
Beta Was this translation helpful? Give feedback.
-
Sure! I am currently following the examples of Combobox found here, the code examples have very minimal type reference so its very difficult to nail the right types. So I head to the running examples here and noticed that the type imports are different as well as the package versions e.g. in the running example import type { AriaPopoverProps } from "@react-aria/overlays"; should be I guess import type { AriaPopoverProps } from "react-aria"; |
Beta Was this translation helpful? Give feedback.
-
Also just to double check with the code examples import {Item, useComboBoxState} from 'react-stately'; Is Item an export from react-stately or RAC? |
Beta Was this translation helpful? Give feedback.
I think if you haven't declared an explicit dependency on
@react-aria/overlays
it's better to import it fromreact-aria
. That way you aren't relying on it being installed via some implicit dependency. Maybe that's why your TS is complaining?