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

injectIntl return type omits children props #1704

Closed
AustinBrunkhorst opened this issue Jun 7, 2020 · 0 comments · Fixed by #1716
Closed

injectIntl return type omits children props #1704

AustinBrunkhorst opened this issue Jun 7, 2020 · 0 comments · Fixed by #1716
Assignees
Labels

Comments

@AustinBrunkhorst
Copy link

Which package?
react-intl

Describe the bug
injectIntl omits the children props. This might be somehow related to #1697

Edit charming-fermat-tx5qp

To Reproduce
Consider this example

interface IProps extends WrappedComponentProps {
  someProp?: boolean;
}

class TestBase extends React.PureComponent<IProps> {
  public render() {
    return this.props.children;
  }
}

const Test = injectIntl(TestBase);

using Test like so

<Test>test</Test>

Emits the following error in typescript

Type '{ children: string; }' has no properties in common with type 'IntrinsicAttributes & Pick<IProps, "someProp"> & { forwardedRef?: ((instance: any) => void) | RefObject | null | undefined; } & RefAttributes<...>'.ts(2559)

Expected behavior
The return type from injectIntl should include children.

Screenshots
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants