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

String literals defined in another file don't get translated to propTypes #39

Closed
ericyliu opened this issue Jul 20, 2020 · 0 comments
Closed

Comments

@ericyliu
Copy link

if I define a string literal in a separate file from the react component, and use that string literal in the props of the react component, the resulting proptypes dont contain that key.

i.e.
heading.constants.ts

export type LEVEL = '1' | '2' | '3';

heading.ts

import { LEVEL } from './heading.constants.ts';

interface Props {
  level: LEVEL,
}

export const Header = (props: Props) => {
  <div>{props.level}</div>
}

dist/index.ts

...
Header.propTypes = {};
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

1 participant