-
-
Notifications
You must be signed in to change notification settings - Fork 482
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
[bug] typescript FieldRenderProps do not include custom props passed to Field #175
Comments
any update on this? |
Also have the same issue - any update? |
Is there a reason we are not using |
We are also encountering this problem and would very much appreciate a fix or workaround suggestions |
A workaround I've found is to declare custom props optional (and add a big FIXME) // FIXME making custom props optional until this is resolved:
// https://github.com/final-form/react-final-form/issues/175
export interface FieldLayoutProps extends FieldRenderProps {
label?: string;
Control?: string;
} |
@erikras what is the current behaviour to use custom |
@erikras any info about when it will be published? |
Published fix in |
Are you submitting a bug report or a feature request?
bug report
What is the current behavior?
The typescript defs assume that only
FieldRenderProps
are passed tocomponent
,render
, andchildren
(https://github.com/final-form/react-final-form/blob/master/src/index.d.ts#L58-L69) when in factFieldRenderProps
AND "any non-API props passed into the component" are passed tocomponent
,render
, andchildren
.This results in type errors when custom props passed to
Field
are required by thecomponent
:...assume
FieldLayoutProps
is minimally defined as:What is the expected behavior?
The typescript defs include "any non-API props passed into the component" in
FieldRenderProps
so that there is no compile-time type error whencomponent
requires props passed toField
.This would match:
What's your environment?
react-final-form@3.1.0, typescript@2.7.1
using the tsc compiler options
noImplicitAny
andstrictNullChecks
The text was updated successfully, but these errors were encountered: