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

Remove explicit children: typing in BalancerOwnProps #83

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

anulman
Copy link
Contributor

@anulman anulman commented Aug 28, 2023

Since children is inherited from React.HTMLAttributes<ElementType> anyway, the re-definition risks conflicts with projects that may extend this type.

For example, react-i18next allows users to opt-in to extending children: ... to allow for variable insertion in its <Trans> components: https://github.com/i18next/react-i18next/blob/master/index.d.ts#L47-L57

By removing the children: ... specification here in favor of the inherited definition, we allow react-wrap-balancer's children to match any custom overrides of the React types.

Since `children` is inherited from `React.HTMLAttributes<ElementType>` anyway, the re-definition risks conflicts with projects that may extend this type.

For example, `react-i18next` allows users to opt-in to extending `children: ...` to allow for variable insertion in its `<Trans>` components: https://github.com/i18next/react-i18next/blob/master/index.d.ts#L47-L57

By removing the `children: ...` specification here in favor of the inherited definition, we allow `react-wrap-balancer`'s children to match any custom overrides of the React types.
@vercel
Copy link

vercel bot commented Aug 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-wrap-balancer ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 28, 2023 4:50pm

@shuding
Copy link
Owner

shuding commented Sep 2, 2023

Thanks!

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.

2 participants