Hi. From last Friday I am having this error in code generated by Plasmic:
Uncaught TypeError: Invalid value used in weak set
at WeakSet.add (<anonymous>)
at ref (vanilla.js?0d39:211:1)
at mkUntrackedValue (react-web.esm.js?80bc:1739:1)
at saveStateInitialValue (react-web.esm.js?80bc:2002:1)
at initializeStateValue (react-web.esm.js?80bc:1982:1)
at eval (react-web.esm.js?80bc:2036:1)
at Object.get (react-web.esm.js?80bc:1850:1)
at hasVariant (react-web.esm.js?80bc:428:1)
at PlasmicRecommendedSku__RenderFunc (PlasmicRecommendedSku.tsx?5f9b:97:1)
at func (PlasmicRecommendedSku.tsx?5f9b:167:1)
it looks like an error with React.useMemo hook when using variants. Can someone help me to avoid this problem?
Line of code that is failing:
{
RecommendedSku__textcomplex__o3HiNoK2Lo: hasVariant($state, 'complex', 'complex'),
},
useMemo hook:
const stateSpecs = React.useMemo(
() => [
{
path: 'complex',
type: 'private',
initFunc: ($props, $state) => $props['complex'],
},
],
[$props],
);