Skip to content

Fix TextInput prop types & remove system props - #1414

Merged
jfuchs merged 1 commit into
mainfrom
jfuchs/textinput-types
Sep 9, 2021
Merged

jfuchs merged 1 commit into
mainfrom
jfuchs/textinput-types

Conversation

@jfuchs

@jfuchs jfuchs commented Sep 8, 2021 •

Copy link
Copy Markdown
Contributor

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 a team and colebemis September 8, 2021 19:29
@changeset-bot

changeset-bot Bot commented Sep 8, 2021 •

Copy link
Copy Markdown

🦋 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

jfuchs commented Sep 8, 2021

Copy link
Copy Markdown
Contributor Author

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

@github-actions

github-actions Bot commented Sep 8, 2021 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

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

@jfuchs
jfuchs force-pushed the jfuchs/textinput-types branch from 586d40d to ab7cfb1 Compare September 9, 2021 21:19
@jfuchs
jfuchs force-pushed the jfuchs/textinput-types branch from ab7cfb1 to e6959bd Compare September 9, 2021 21:35

@colebemis colebemis left a comment

Copy link
Copy Markdown
Contributor

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