useWidget<
W
>(createWidget
,props
,propsConfig
?): [WidgetState
<W
>,W
]
The useWidget function.
Allows to create and attach an agnos-ui/core widget to the current react component.
• W extends Widget
<object
, object
, object
, object
, object
>
• createWidget: WidgetFactory
<W
>
the widget factory
• props: Partial
<WidgetProps
<W
>> = {}
the props
• propsConfig?: PropsConfig
<WidgetProps
<W
>>
the props config
[WidgetState
<W
>, W
]
the state and api to track and interact with the widget