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

Improve types for BaseInputProps #64

Closed
danielbuechele opened this issue Apr 28, 2019 · 1 comment · Fixed by #65
Closed

Improve types for BaseInputProps #64

danielbuechele opened this issue Apr 28, 2019 · 1 comment · Fixed by #65
Labels
enhancement Improve existing functionality in progress This issue is currently under development
Milestone

Comments

@danielbuechele
Copy link
Contributor

The type definition for BaseInputProps types the name as string. However, we could type this more strictly: https://github.com/wsmd/react-use-form-state/blob/master/src/index.d.ts#L135

-interface BaseInputProps {
+interface BaseInputProps<T> {
  id: string;
  onChange(event: any): void;
  onBlur(event: any): void;
  value: string;
-  name: string;
+  name: keyof T;
  type: string;
}

I would create a PR, but the version published to NPM differs from the one here on GitHub, so I am not sure if all changes are yet pushed to GitHub

@wsmd
Copy link
Owner

wsmd commented Apr 28, 2019

Good point! I like that 👍

RE: npm/GitHub - The code on the master branch always include the latest upcoming changes - it does not necessarily reflect what's on npm as latest. In other words, the link you attached is pointing to most up-to-date code that will be published in the next release.

0.9.1 was an exception since I didn't see any reason to hold off until the next release after giving it some thought. (744d54a of master is tagged with 0.9.1)

https://github.com/wsmd/react-use-form-state/tree/0.9.1

Please feel free to open a PR against master - If you were to make those changes, they will be published in the next release.

I should probably consider a better git/branching flow as more contributors are helping with the project. I'm thinking maybe a next development branch, with master being the npm latest.

@wsmd wsmd added the enhancement Improve existing functionality label Apr 28, 2019
danielbuechele added a commit to danielbuechele/react-use-form-state that referenced this issue Apr 28, 2019
@wsmd wsmd added this to the 0.10.0 milestone Apr 28, 2019
@wsmd wsmd added the in progress This issue is currently under development label Apr 28, 2019
@wsmd wsmd closed this as completed in #65 Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve existing functionality in progress This issue is currently under development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants