Class
This base class defines some common methods for a widget. A widget is a React component. We don't recommend extending this class. Use the functional React component instead.
Inheritance: defaultPureComponent<P, S>
Constructors
Properties
Property | Type | Notes |
---|---|---|
(state: IMState, ownProps: Partial<AllWidgetProps<any>>) => any | The framework has injected many props into the widget props. Check | |
The version manager of a widget (optional) |
versionManager
staticoptional
Class PropertyversionManager: WidgetVersionManager | BaseVersionManager<any>
The version manager of a widget (optional)
mapExtraStateProps: (state: IMState, ownProps: Partial<AllWidgetProps<any>>) => any
The framework has injected many props into the widget props. Check
AllWidgetProps
to see the details. If your widget needs to use more state, you can use this function. However, for functional components, theuseSelector
hook is recommended.Type declaration
function(state: IMState, ownProps: Partial<AllWidgetProps<any>>): any
Parameters
state
own Props
Returns
any