-
Notifications
You must be signed in to change notification settings - Fork 2
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 support? #1
Comments
Yeah sure we can add a .d.ts file reflecting the proptypes. |
It is possible to either generate the .d.ts file automatically (source) or manually. Which one would you prefer? P.S. Running
So probably it's best to update the package with the latest dependencies before adding anything new. P.S.S. Automatic generation may not be the best option since it generates very generic definitions with almost anything being typed as index.d.tsexport default Only;
declare class Only {
static defaultProps: {
hiddenMode: string;
className: string;
};
static propTypes: {
/** A single child element */
children: any;
/** When true, children will rendered as is */
when: any;
/** Determines how "react-only-when" should hide the child element
* "withNull": Will not render the child
* "withDisplay": Will render the child with display:none
* "withVisibility": Will render the child with visibility:hidden
* "withCss": Will render the child with a CSS class (you can pass it a custom className prop)
*/
hiddenMode: any;
/** This is working in combination with hiddenMode={"withCss"} */
className: any;
};
render(): any;
} |
Good day. I was wondering if there are any plans to export typescript definitions so the
Only
component can be easily imported by TS?The text was updated successfully, but these errors were encountered: