Home > @uniformdev/canvas > ComponentEnhancerFunction
ComponentEnhancerFunction type
A function which is called for each matching component in a composition, which can manipulate the value of a specific key in the component's data
property. Used to enhance layout data with information from other platforms, such as private APIs, where the value is not tied to a parameter and is intrinsic to the component itself.
Note: the configuration of enhancers namespaces component enhancers into a named property on the data object to avoid collisions, thus an enhancer need not worry about merging values with other enhancers, nor which key it has been registered under.
Return values: TValue - sets the configured key in the component's data value to this value undefined - do not set the component's data key
Signature:
References: EnhancerContext, ComponentEnhancerOptions