Skip to content
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

Introduce typescript build support for PF4 #752

Closed
Tracked by #678
dgutride opened this issue Oct 12, 2018 · 2 comments
Closed
Tracked by #678

Introduce typescript build support for PF4 #752

dgutride opened this issue Oct 12, 2018 · 2 comments
Assignees
Milestone

Comments

@dgutride
Copy link
Member

PF4 components need to provide typings for consumption. We'd like to build the components natively in typescript instead of writing typings that could get out of sync.

This issue is to introduce just build support and convert the propTypes for a single component to illustrate how it should be done.

@tconn89
Copy link

tconn89 commented Oct 24, 2018

@dgutride Upon inspection, I already see that components have a {{component}}.d.ts file. For instance, AboutModal.d.ts looks like this:

import { SFC, HTMLProps, ReactNode } from 'react';

export interface AboutModalProps extends HTMLProps<HTMLDivElement> {
  children: ReactNode;
  isOpen?: boolean;
  onClose?: Function;
  productName: string;
  trademark: string;
  brandImageSrc: string;
  brandImageAlt: string;
  logoImageSrc: string;
  logoImageAlt: string;
  heroImageSrc: string;
  heroImageAlt?: string;
}

declare const AboutModal: SFC<AboutModalProps>;

export default AboutModal;

Is this what you meant by supporting PropTypes natively? I did have to overcome a bug with importing react-styles and had to declare new module, but that is a different issue.

@LHinson LHinson added this to the 1.0.0-alpha.6 milestone Oct 31, 2018
@rachael-phillips
Copy link
Contributor

Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants