Function makeBindableComponent
- makeBindableComponent<PropsT, PassThruKeyT>(functionalComponent): ((props: UpgradeToBindingsProps<PropsT, PassThruKeyT>) => JSX.Element)
Type Parameters
- PropsT extends Record<string, any>
- PassThruKeyT extends string = never
Parameters
- functionalComponent: ((props: PropsT) => Element)
- (props): Element
Returns Element
- (props): JSX.Element
Returns JSX.Element
- makeBindableComponent<PropsT, PassThruKeyT>(options, functionalComponent): ((props: UpgradeToBindingsProps<PropsT, PassThruKeyT>) => JSX.Element)
Type Parameters
- PropsT extends Record<string, any>
- PassThruKeyT extends string = never
- (props): JSX.Element
Returns JSX.Element
Take a functional component and creates a new functional component that takes binding props. The non-bound types are also still accepted.
The component will be re-rendered any time binding props change.
The bindings are resolved before calling the original component.
Bindings can also be passed through by specifying key names in the
passThru
option.