Skip to content

Commit 9003b81

Browse files
committed
fix(memo): add internal version counter
Adds an internal version counter, as we can't rely on memo data by the time it gets to react/react-native
1 parent 77421c5 commit 9003b81

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/sdks/mitosis.config.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ const MEMOIZING_BLOCKS_COMPONENT_PLUGIN = () => ({
257257
'export default memo(Block, isEqual)'
258258
);
259259
}
260+
if (json.name === 'ContentComponent') {
261+
return code.replace(
262+
'rootState: newRootState,',
263+
'rootState: { ...newRootState, __builder_stateVersion: (Number(PREVIOUS_VALUE.rootState.__builder_stateVersion) || 0) + 1 },'
264+
);
265+
}
260266
return code;
261267
},
262268
},

0 commit comments

Comments
 (0)