Skip to content

Commit 1639d79

Browse files
committed
fix(renderer): Do not memoize condition triggers function
- this breaks if multiple fields are using same function (will be problem in field arrays)
1 parent 11cff66 commit 1639d79

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/react-form-renderer/src/get-condition-triggers/get-condition-triggers.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { memoize } from '../common';
2-
31
const mergeFunctionTrigger = (fn, field) => {
42
let internalTriggers = [];
53
const internalWhen = fn(field);
@@ -12,7 +10,7 @@ const mergeFunctionTrigger = (fn, field) => {
1210
return internalTriggers;
1311
};
1412

15-
const getConditionTriggers = memoize((condition, field) => {
13+
const getConditionTriggers = (condition, field) => {
1614
let triggers = [];
1715
if (Array.isArray(condition)) {
1816
return condition.reduce((acc, item) => [...acc, ...getConditionTriggers(item, field)], []);
@@ -49,6 +47,6 @@ const getConditionTriggers = memoize((condition, field) => {
4947
});
5048

5149
return Array.from(new Set(triggers));
52-
});
50+
};
5351

5452
export default getConditionTriggers;

0 commit comments

Comments
 (0)