Skip to content

Conversation

@Josh-Cena
Copy link

React.Component is something like function Comp() {...} or class Comp extends Component, while React.ReactElement is like <Comp />, the "return value" of a component. This has blocked me from doing something like React.Children.toArray(datum).

@Josh-Cena Josh-Cena changed the title fix: Datum.toComponent() should return ReactElement instead of Component fix(types): Datum.toComponent() should return ReactElement instead of Component Apr 9, 2022
@Josh-Cena
Copy link
Author

@staylor Could you take a look at this, please?

@OliverJAsh
Copy link

FWIW the same fix was made to react-helmet. DefinitelyTyped/DefinitelyTyped@b0ff447

@Josh-Cena
Copy link
Author

It's been two years and after the types refactor the bug is still actual. @staylor?

@daniel-ac-martin
Copy link

I've also it this. Would be nice if it could be fixed.

I wonder if the method's name should also change though!

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