hi team, i create custom vis and have issue while updating my default state.
this is my editor script:
export class StandardDeviationFilterEditor extends React.Component {
onChange = (selectedOptions) => {
this.props.stageEditorParams({
selected: selectedOptions,
});
};
render() {
const { selectedOptions } = this.state;
console.log("editor state: ",this.props.editorState.params.selected.label)
return (
<div>
<EuiTitle size="xxs">
<h1>Choose index for search in</h1>
</EuiTitle>
<EuiComboBox
singleSelection={{ asPlainText: true }}
options={this.options}
selectedOptions={selectedOptions}
onChange={this.onChange}
isClearable={false}
/>
</div>
);
}
}
this is default vis parameters:
return VisFactory.createReactVisualization({
name: 'standard_deviation_filter_vis',
title: 'Standard Deviation Filter Vis',
icon: 'visGoal',
description: 'Standard deviation filter vis search',
visConfig: {
component: StandardDeviationFilterComponent,
defaults: {
selected: {label:"None"},
},
},
editorConfig: {
optionTabs: [
{
name: 'options',
title: 'Options',
editor: StandardDeviationFilterEditor,
},
],
},
requestHandler: 'none',
stage: "experimental"
});
so console.log shows None first and undefined at second. Please, help me find mistakes.