Skip to content

Conversation

kettanaito
Copy link
Owner

Introduces a basic typings in TypeScript.

Subjected to merge after a prior discussion.

): (
component: (
props: P & {
fieldProps: React.InputHTMLAttributes<HTMLInputElement>
Copy link

@lemcii lemcii Nov 3, 2018

Choose a reason for hiding this comment

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

React.HTMLAttributes rather than React.InputHTMLAttributes<HTMLInputElement> might be a better choice, I thought about adding all variants but that'd require type assertion.

@kettanaito
Copy link
Owner Author

What do you think about modularizing type definitions, @Ell10t?

@lemcii
Copy link

lemcii commented Nov 12, 2018

No objections here, if it makes it more manageable it's probably not a bad idea.

@kettanaito
Copy link
Owner Author

@Ell10t I will try to break it down then.

Apart from that, the only crucial thing that is left is a type definition of that [valuePropName] in various callbacks. Within createField scope it should be possible to do via generics, but I am not sure how to handle it in Form callback methods.

@lemcii
Copy link

lemcii commented Nov 12, 2018

Alright, if I get time I'll have a look into the generics as well.

@kettanaito kettanaito changed the title WIP Typings TypeScript type definitions Nov 27, 2018
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