Fix issue with memoizing onclick handlers nested inside conditional UI conditions

This commit is contained in:
Andrew Kingston 2021-08-23 16:39:09 +01:00
parent 3fc345a8fe
commit 0a12089a54
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,12 @@ export const enrichProps = (props, context) => {
condition.settingValue,
totalContext
)
// If there is an onclick function in here then it won't be serialised
// properly, and therefore will not be updated properly.
// The solution to this is add a rand which will ensure diffs happen
// every time.
condition.rand = Math.random()
}
})
}