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

(revert) [TypeScript] Fixed type for "GetInputPropsOptions" #641

Merged
merged 1 commit into from
Jan 5, 2019

Conversation

franklixuefei
Copy link
Collaborator

@franklixuefei franklixuefei commented Jan 5, 2019

Revert #639
I decided to revert this change for the following reasons:

  1. For now, downshift is not designed for textareas, so it doesn't make sense to account for the props that a textarea has in typings, which adds to the complexity of the type definitions.
  2. this will no longer work (typescript compiler will throw):
<input {...getInputProps(...)} />

because the returned type React.HTMLProps<HTMLInputElement | HTMLTextAreaElement> cannot be assigned to React.HTMLProps<HTMLInputElement>

Checklist:

  • Documentation
  • Tests
  • Ready to be merged
  • Added myself to contributors table

Revert #639 
I decided to revert this change for the following reasons:
1. For now, downshift is not designed for textareas, so it doesn't make sense to account for the props that a textarea has in typings, which adds to the complexity of the type definitions.
2. this will no longer work (typescript compiler will throw):
```jsx
<input {...getInputProps(...)} />
```
because the returned type `React.HTMLProps<HTMLInputElement | HTMLTextAreaElement>` cannot be assigned to `React.HTMLProps<HTMLInputElement>`
@franklixuefei
Copy link
Collaborator Author

Test passed locally:

PS C:\opensource\downshift> yarn test:ts
yarn run v1.12.3
$ tsc --noEmit -p ./tsconfig.json
Done in 13.50s.

@kentcdodds kentcdodds merged commit c21731a into master Jan 5, 2019
@kentcdodds kentcdodds deleted the franklixuefei-patch-2 branch January 5, 2019 03:23
@kentcdodds
Copy link
Member

Thanks. Unfortunately because the build it's busted this won't get released until we get that fixed ☹️

@kentcdodds
Copy link
Member

🎉 This PR is included in version 3.1.9 🎉

The release is available on:

Your semantic-release bot 📦🚀

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 this pull request may close these issues.

None yet

2 participants