Are you submitting a bug report or a feature request?
Feature request
What is the current behavior?
Type errors with react-native + typescript
What is the expected behavior?
No type errors :P
What's your environment?
I'm using react-final-form with react-native
"react-final-form": "^2.1.1",
"final-form": "^3.0.0",
"react": "16.0.0",
"react-native": "0.50.4",
Other information
There are two situations where I have type errors.
1. handleSubmit
The current type for handleSubmit is:
handleSubmit: (event: React.SyntheticEvent<HTMLFormElement>) => void
How can we deal with this in react-native?
onPress events of touchables have this signature:
onPress?: (event: GestureResponderEvent) => void;
2. Field extra props
Sometimes we need to pass some extra props to the underlying component of Field
<Field
name='firstName'
component={TextInputField}
style={styles.textInputStyle}
/>
In this case, the style prop is the extra one.
The type system complains because the props that Field is expecting are:
export type FieldProps = {
allowNull?: boolean
format?: ((value: any, name: string) => any) | null
parse?: ((value: any, name: string) => any) | null
name: string
subscription?: FieldSubscription
validate?: (value: any, allValues: object) => any
value?: any
} & RenderableProps<FieldRenderProps>
Maybe we should allow anything here? :\ 👎
Are you submitting a bug report or a feature request?
Feature request
What is the current behavior?
Type errors with react-native + typescript
What is the expected behavior?
No type errors :P
What's your environment?
I'm using react-final-form with react-native
Other information
There are two situations where I have type errors.
1. handleSubmit
The current type for handleSubmit is:
How can we deal with this in react-native?
onPress events of touchables have this signature:
2. Field extra props
Sometimes we need to pass some extra props to the underlying component of Field
In this case, the
styleprop is the extra one.The type system complains because the props that Field is expecting are:
Maybe we should allow anything here? :\ 👎