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 TextInput prop types & remove system props #1414

Merged
merged 1 commit into from
Sep 9, 2021
Merged

Conversation

jfuchs
Copy link
Contributor

@jfuchs jfuchs commented Sep 8, 2021

This PR should give us a more accurate type for the props of TextInput. Previously the props included:

type TextInputInternalProps = {
  // etc
} & ComponentProps<typeof Wrapper> &
  ComponentProps<typeof Input>

But that left some props as a messy intersection of types, like onChange (#1377). We can resolve that by explicitly omitting any fields from Input's props that are explicitly destructured from TextInput's props.

Closes #1377

See also #1163

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@jfuchs jfuchs requested review from colebemis and a team September 8, 2021 19:29
@changeset-bot
Copy link

changeset-bot bot commented Sep 8, 2021

🦋 Changeset detected

Latest commit: e6959bd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/components Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@jfuchs
Copy link
Contributor Author

jfuchs commented Sep 8, 2021

I've got some tests to fix, but wanted to put up the PR to get feedback on the approach

@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2021

size-limit report 📦

Path Size
dist/browser.esm.js 48.59 KB (-0.23% 🔽)
dist/browser.umd.js 48.85 KB (-0.21% 🔽)

Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jfuchs jfuchs merged commit f4e1de6 into main Sep 9, 2021
@jfuchs jfuchs deleted the jfuchs/textinput-types branch September 9, 2021 22:34
@primer-css primer-css mentioned this pull request Sep 9, 2021
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.

Inaccurate type for TextInput's onChange property
2 participants