puck icon indicating copy to clipboard operation
puck copied to clipboard

fix: add optional ref prop to DropZones and slots

Open FedericoBonel opened this issue 4 weeks ago • 1 comments

Closes #1439

Description

This PR fixes a type issue where refs were not accepted in Slot render functions or DropZones, which did not match internal or documented behavior.

Changes made

  • The DropZoneProps type now includes an optional ref prop.

How to test

  1. Define a component that uses a slot and pass a ref to that slot:
SomeSlot: {
  fields: {
    content: { type: "slot" },
  },
  render: ({ content: Content }) => {
    const ref = useRef<HTMLDivElement>(null);

    return <Content ref={ref} />;
  },
},
  1. Confirm that TypeScript does not throw an error.

FedericoBonel avatar Nov 27 '25 02:11 FedericoBonel

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
puck-demo Ready Ready Preview Comment Nov 27, 2025 2:32am
puck-docs Ready Ready Preview Comment Nov 27, 2025 2:32am

vercel[bot] avatar Nov 27 '25 02:11 vercel[bot]