Description
Currently field transforms are only used within Puck, but it would be useful if we could provide it to the Render component.
This would make it possible to apply field transformations at render time after a user (or AI) has created a page.
resolveData doesn't work in a lot of these cases since it pollutes the data payload and it expects JSON returned from it, whereas field transforms could return components and be computed every time.
Proposals
Add the fieldTransforms API to the Render component:
export function Page() {
return (
<Render
fieldTransforms={{
text: ({ value }) => <Heading body={value} />, // Convert all text values into `Heading` components
}}
/>
);
}
Description
Currently field transforms are only used within
Puck, but it would be useful if we could provide it to theRendercomponent.This would make it possible to apply field transformations at render time after a user (or AI) has created a page.
resolveDatadoesn't work in a lot of these cases since it pollutes the data payload and it expects JSON returned from it, whereas field transforms could return components and be computed every time.Proposals
Add the
fieldTransformsAPI to the Render component: