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

fix(types): Datum.toComponent() should return ReactElement instead of Component #167

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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