Puck 0.24 doesn’t introduce any breaking changes, but it updates how fields are exposed to the fields override and makes field placeholders visible in the canvas when inline editing is enabled.
This guide covers the steps for upgrading to Puck 0.24:
If you encounter any bugs as you upgrade to Puck 0.24, please report them via GitHub.
For a list of all the new features added to Puck 0.24, check out the release blog post.
Run the following command to install the latest version of Puck:
npm install @puckeditor/core@latestNo breaking changes were introduced in this release.
No deprecations were introduced in this release.
fields overrides that use React.ChildrenThe fields override now receives the component’s individual field nodes through the fields prop.
The children prop still contains the complete field layout, but it no longer exposes each field as a direct child. If your override uses React.Children to arrange individual fields, use the new fields prop instead:
// Before
const overrides = {
fields: ({ children }) => (
<div className="FieldGrid">
{React.Children.map(children, (field) => (
<div>{field}</div>
))}
</div>
),
};// After
const overrides = {
fields: ({ fields }) => (
<div className="FieldGrid">
{Object.entries(fields).map(([name, field]) => (
<div key={name}>{field}</div>
))}
</div>
),
};Overrides that render children without inspecting or rearranging its contents will continue to work.
The placeholder on text and textarea fields is now visible in the canvas when contentEditable is enabled.
Check out the full changelog, including known issues, on the GitHub release.
If you’re interested in learning more about Puck, check out the demo or read the docs. If you like what you see, please give us a star on GitHub to help others find Puck too!