@@ -15,6 +15,7 @@ import { usePickerJSActions } from "../helpers/usePickerJSActions";
15
15
import { withCustomOptionsGuard } from "../hocs/withCustomOptionsGuard" ;
16
16
import { StaticSelectFilterStore } from "../stores/StaticSelectFilterStore" ;
17
17
import { FilterOptionsType , SelectedItemsStyleEnum , SelectionMethodEnum } from "../typings/widget" ;
18
+ import { useSetup } from "@mendix/widget-plugin-mobx-kit/react/useSetup" ;
18
19
19
20
export interface StaticFilterContainerProps {
20
21
ariaLabel ?: string ;
@@ -52,7 +53,7 @@ function Container(props: StaticFilterContainerProps): React.ReactElement {
52
53
53
54
const SelectWidget = observer ( function SelectWidget ( props : StaticFilterContainerProps ) : React . ReactElement {
54
55
const gate = useGate ( props ) ;
55
- const ctrl1 = useConst ( ( ) => new StaticSelectController ( { gate } ) ) ;
56
+ const ctrl1 = useSetup ( ( ) => new StaticSelectController ( { gate } ) ) ;
56
57
57
58
usePickerJSActions ( ctrl1 , props ) ;
58
59
@@ -73,7 +74,7 @@ const SelectWidget = observer(function SelectWidget(props: StaticFilterContainer
73
74
74
75
const ComboboxWidget = observer ( function ComboboxWidget ( props : StaticFilterContainerProps ) : React . ReactElement {
75
76
const gate = useGate ( props ) ;
76
- const ctrl2 = useConst ( ( ) => new StaticComboboxController ( { gate } ) ) ;
77
+ const ctrl2 = useSetup ( ( ) => new StaticComboboxController ( { gate } ) ) ;
77
78
78
79
usePickerJSActions ( ctrl2 , props ) ;
79
80
@@ -94,7 +95,7 @@ const ComboboxWidget = observer(function ComboboxWidget(props: StaticFilterConta
94
95
95
96
const TagPickerWidget = observer ( function TagPickerWidget ( props : StaticFilterContainerProps ) : React . ReactElement {
96
97
const gate = useGate ( props ) ;
97
- const ctrl3 = useConst ( ( ) => new StaticTagPickerController ( { gate } ) ) ;
98
+ const ctrl3 = useSetup ( ( ) => new StaticTagPickerController ( { gate } ) ) ;
98
99
99
100
usePickerJSActions ( ctrl3 , props ) ;
100
101
0 commit comments