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

typescript typing: use React.ElementType rather than React.ComponentType #354

Merged
merged 1 commit into from
Dec 1, 2020

Conversation

cheapsteak
Copy link
Contributor

@cheapsteak cheapsteak commented Nov 30, 2020

Currently providing overrides using intrinsic elements like

p: {
  component: 'p',
  props: {
    className: 'inline',
  },
},

will result in a typescript error of Type 'string' is not assignable to type 'ComponentType<any>'., even though it works

React.ElementType includes intrinsic elements and I believe is more appropriate here

Copy link
Owner

@quantizor quantizor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Successfully merging this pull request may close these issues.

2 participants