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
add props.children to StatelessComponent #10641
Conversation
Handles `props.children` in `StatelessComponent` as in `Component`. Treats `<Foo children={Bar} />` in the same way as `<Foo><Bar /></Foo>`.
Reading the comment on @RyanCavanaugh you can an opinion? |
Any update on this? :) // cc @RyanCavanaugh |
I think this is an OK change for now. We'll probably be handling the question of |
Just as a reference for others: you're speaking about microsoft/TypeScript#8588, right? |
That's right |
@donaldpipowitch can you update the PR to resolve the merge conflict? Then it looks like it is ready to merge. Thanks! |
I'd like to do that after #11935 has been merged. It touches the same line, but is way more important. I don't want to introduce more barriers there. |
@donaldpipowitch Looks like #11935 has been merged. Do you plan to resolve the merge conflict? As this PR is getting stale, I plan to close it out soon if no changes. Thank you. |
@RyanCavanaug You said "I think this is an OK change for now. We'll probably be handling the question of children in TS 2.1 but this will be a good workaround in the meantime." 2.1 is around the corner, was this solved or is this workaround still useful? |
It looks like this was already added...? https://github.com/DefinitelyTyped/DefinitelyTyped/blob/types-2.0/react/index.d.ts#L204 |
case 2. Improvement to existing type definition.
Handles
props.children
inStatelessComponent
as inComponent
. Treats<Foo children={Bar} />
in the same way as<Foo><Bar /></Foo>
withconst Foo: StatelessComponent = (props) => <div>{props.children}</div>
.