Skip to content

Conversation

@akameco
Copy link
Contributor

@akameco akameco commented Mar 19, 2019

ReactType is deprecated.

see DefinitelyTyped/DefinitelyTyped#33263

## `as` props (passing a component to be rendered)

`ReactType` is pretty useful to cover most types that can be passed to createElement e.g.
`ElementType` is pretty useful to cover most types that can be passed to createElement e.g.
Copy link
Member

Choose a reason for hiding this comment

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

Now that I'm reading this: Shouldn't it cover all types?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd have to double check but it may break on exotic components, although I do think we covered that use case too.

@akameco akameco force-pushed the fix/react-element-type branch from c8b42d8 to 6604018 Compare March 19, 2019 18:11
@akameco akameco force-pushed the fix/react-element-type branch from 6604018 to c01f124 Compare March 19, 2019 18:16
@swyxio
Copy link
Collaborator

swyxio commented Mar 20, 2019

TIL. cheers all!

@swyxio swyxio merged commit 1dfda0b into typescript-cheatsheets:master Mar 20, 2019
@akameco akameco deleted the fix/react-element-type branch March 20, 2019 05:08
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.

4 participants