Hi team, thank you for your amazing work.
Recently, I have noticed a very critical issue in the latest version of plasmic, DataProvider
no longer works.
You can use the following Code Component to test
import { ComponentMeta, DataProvider } from '@plasmicapp/host';
import { ReactNode } from 'react';
export const CTTestMeta: ComponentMeta<{ children: ReactNode }> = {
name: 'CTTest',
displayName: 'CT Test',
importPath: '@ct/ui/lib/@ct/CTTest',
isDefaultExport: true,
providesData: true,
props: {
children: {
type: 'slot',
defaultValue: [
{
type: 'text',
value: 'Text content',
},
],
},
},
};
export default function CTTest(props: { children: ReactNode }) {
return (
<DataProvider name="justData" data={{ name: 'Jack Vo' }}>
{props.children}
</DataProvider>
);
}
In browser’s Plasmic app, when I tried to set Dynamic value
for the children’s Text node’s content, the $ctx
data that normally would allow me to pick the data
value is not showing up in the Data Picker
tab.
In the generated codegen, the $ctx
provided by ph.DataCtxReader
is undefined
<CtTest
data-plasmic-name={'ctTest'}
data-plasmic-override={overrides.ctTest}
className={classNames('__wab_instance', sty.ctTest)}
>
<ph.DataCtxReader>
{($ctx) => ( // THIS IS UNDEFINED
<div
data-plasmic-name={'text'}
data-plasmic-override={overrides.text}
className={classNames(
projectcss.all,
projectcss.__wab_text,
sty.text,
)}
>
{'Hyperlink'}
</div>
)}
</ph.DataCtxReader>
</CtTest>
This is quite a critical issue as it stopped a lot of my Code Component from working so it will be great if the team can help us to address this issue.
Thank you