-
Notifications
You must be signed in to change notification settings - Fork 91
Introduce resolve props #651
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
Conversation
We should follow the current order of priority
|
ea97e23
to
fbed84c
Compare
Codecov Report
@@ Coverage Diff @@
## master #651 +/- ##
==========================================
+ Coverage 93.00% 93.02% +0.02%
==========================================
Files 189 189
Lines 3015 3025 +10
Branches 990 997 +7
==========================================
+ Hits 2804 2814 +10
Misses 211 211
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rvsia can you open an issue to cache the use field return value? It should improve performance a bit.
@@ -9,6 +9,8 @@ export interface FieldActions { | |||
[key: string]: FieldAction; | |||
} | |||
|
|||
export type ResolvePropsFunction = (props: AnyObject, metaInput: AnyObject, formOptions: AnyObject) => AnyObject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta and form options types should be defined. You can use the final form meta props definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I missed formOptions, I will add it tomorrow.
|
||
export type FieldAction = [string, ...any[]]; | ||
|
||
export interface FieldActions { | ||
[key: string]: FieldAction; | ||
} | ||
|
||
export interface InputMeta<FieldValue, T extends HTMLElement = HTMLElement> { | ||
meta: FieldMetaState<FieldValue>; | ||
input: FieldInputProps<FieldValue, T>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you only want the meta
typing right? Input is not passed to the function,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then the name is a bit confusing. I would expect just the meta
object here. Can we change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's called InputMeta.. should it be InputAndMeta? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about fieldApi
?
🎉 This PR is included in version 2.8.0 🎉 The release is available on Demo can be found here! |
closes #646
For more details read the documentation page
This PR
resolveProps
for form-connected fieldsExample of resolve props