Skip to content

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: BaseWidgetPureComponent<PS>

Constructors

Properties

PropertyTypeNotes
versionManagerWidgetVersionManager | BaseVersionManager<any>

The version manager of a widget (optional)

versionManager

staticoptional
Class Property
versionManager: WidgetVersionManager | BaseVersionManager<any>

The version manager of a widget (optional)

Methods

MethodReturnsNotes
getFullConfig(config)any

A widget can just save partial of its config in an app config. In the runtime, the widget can use this function to get the full config.

mapExtraStateProps(state, ownProps)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, the useSelector hook is recommended.

getFullConfig

staticoptional
Class Method
getFullConfig(configany): any

A widget can just save partial of its config in an app config. In the runtime, the widget can use this function to get the full config.

Parameters
ParameterTypeNotes
configany

The config saved in the app config

Returns 
any

mapExtraStateProps

static
Class Method
mapExtraStateProps(stateIMState, ownPropsPartial<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, the useSelector hook is recommended.

Parameters
ParameterType
stateIMState
ownPropsPartial<AllWidgetProps<any>>
Returns 
any

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.