-
Notifications
You must be signed in to change notification settings - Fork 1k
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: Props aren't exported anymore #1979
Comments
Hi @dattebayorob, I have rewritten all d.ts files to suggest more specific property's values to Users. This topic is about declare namespace. In the next version, I can change the declare namespace with the declare module.
But my personal opinion is to use Button.ButtonProps. WDYT? |
Ummmm Understood, I think it's great @mertsincan , but in this case the version is a Break version. In my case: import { export interface CalendarProps extends Omit<PrimeCalendarProps, 'minDate'>, FormControlLabelProps, FormControlErrorProps { export const Calendar = (props: CalendarProps) => { |
Ok, I'll add the Breaking Changes section to Changelog.md about this.
|
I think the second option is better for compositions import type { CalendarProps } from 'primereact/calendar'; //Only type definition is imported, no code generated after transpile (...) [ Edit ] |
I had raised the same Issue in another location. I also believe the second version to be better for composition types. I'm a it disappointed you can't deep import in JS. Like this
How about the option to make it like this?
|
Just upgraded and my project broke as well 😢 IIRC I'm using the default typescript settings that are used by create-react-app |
Thank you very much for all the feedback! I made some changes again. On 6.3.1;
Thanks a lot for your suggestion, @master117 ;) But, it seems like primereact/component will be better. |
Hi, 6.3.1 Released. Could you please try it? |
Great |
Codesandbox Case (Bug Reports)
https://codesandbox.io/s/optimistic-maxwell-kz1vz?file=/src/App.tsx
[ Edit ]
Just tested, and using "declare namespace" types aren't exported at all.
Using only exports worked: https://gist.github.com/dattebayorob/689b3a8382ea8cad5cf9b3a748d89c79
The text was updated successfully, but these errors were encountered: