Skip to content

Commit 0d21952

Browse files
r0b1ngjulivan
authored andcommitted
fix: set props in effect
1 parent e06d5e2 commit 0d21952

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/shared/widget-plugin-sorting/src/react/hocs/withLinkedSortStore.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useSetup } from "@mendix/widget-plugin-mobx-kit/react/useSetup";
22
import { AttributeMetaData, DynamicValue } from "mendix";
3-
import { createElement, FC } from "react";
3+
import { createElement, FC, useEffect } from "react";
44
import { SortStoreProvider } from "../../helpers/SortStoreProvider";
55
import { BasicSortStore } from "../../types/store";
66
import { SortAPI } from "../context";
@@ -24,7 +24,9 @@ export function withLinkedSortStore<P extends RequiredProps>(
2424
})
2525
);
2626

27-
store.setProps(props);
27+
useEffect(() => {
28+
store.setProps({ attributes: props.attributes });
29+
}, [store, props.attributes]);
2830

2931
return <Component {...props} sortStore={store} />;
3032
};

0 commit comments

Comments
 (0)