You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Components have different params that operate at the full component level: fields, defaultProps, resolveData, etc. It would be great if these params could also work at the field level. For instance, if I create a 'custom' field that is consumable by others but that field also needs special handling in resolveData, I would need to expose multiple functions that the user needs to call. Additionally, if the user calls my custom resolveData function, they can no longer do their own resolveData things if they needed to without reimplementing what my function does.
Below, exposedMyThingFunc returns a 'custom' RenderProps that might show two fields: one for id and one for value (for the myThing field level).
It would be awesome if I could write something I can expose to user that encompasses all of the things you can do for a component at the individual field level. The above could look something like this instead:
foo: {
myThing: {
id: string;
value: string;
},
userThing: string
}
customFields: { // unclear if this should be a different top level or what the name should be
foo: {
myThing: {
fields: exposedMyThingFieldFunc(),
defaultProps: exposedMyThingDefaultPropsFunc,
resolveData: exposedMyThingResolveDataFunc()
}
}
}
fields: {
foo: {
userThing: {
type: "text"
label: "User Thing"
}
}
},
defaultProps: {
foo: {
userThing: "userVal"
}
},
The idea here is that functionality is grouped at the field level rather than the component level. You can imagine going further where instead of this:
Components have different params that operate at the full component level: fields, defaultProps, resolveData, etc. It would be great if these params could also work at the field level. For instance, if I create a 'custom' field that is consumable by others but that field also needs special handling in resolveData, I would need to expose multiple functions that the user needs to call. Additionally, if the user calls my custom resolveData function, they can no longer do their own resolveData things if they needed to without reimplementing what my function does.
Below,
exposedMyThingFunc
returns a 'custom' RenderProps that might show two fields: one for id and one for value (for the myThing field level).This is the current way:
It would be awesome if I could write something I can expose to user that encompasses all of the things you can do for a component at the individual field level. The above could look something like this instead:
The idea here is that functionality is grouped at the field level rather than the component level. You can imagine going further where instead of this:
I expose something to my user that does everything:
The text was updated successfully, but these errors were encountered: