Skip to content

typescript definition label #127

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No 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? No Sign in to your account

Closed
kambing86 opened this issue Jan 28, 2019 · 1 comment
Closed

typescript definition label #127

kambing86 opened this issue Jan 28, 2019 · 1 comment
Labels
Milestone

Comments

@kambing86
Copy link

related to this #125

we cannot just use JSX.Element, because all other types like string will cause error like below now

Type 'string' is not assignable to type 'Element'

according to react js doc, https://reactjs.org/docs/typechecking-with-proptypes.html

  // Anything that can be rendered: numbers, strings, elements or an array
  // (or fragment) containing these types.
  optionalNode: PropTypes.node,
@kambing86
Copy link
Author

kambing86 commented Jan 28, 2019

I believe you can use React.ReactNode in node_modules/@types/react/index.d.ts

@jakezatecky jakezatecky added this to the v1.6.0 milestone Jan 28, 2019
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants