Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderDropZone is not a function in 0.18 canary #778

Open
chrisvxd opened this issue Jan 9, 2025 · 0 comments
Open

renderDropZone is not a function in 0.18 canary #778

chrisvxd opened this issue Jan 9, 2025 · 0 comments
Labels
ready Assumed ready enough to start type: bug 🐛
Milestone

Comments

@chrisvxd
Copy link
Member

chrisvxd commented Jan 9, 2025

When using the RSC render, renderDropZone is not defined. Source.

Steps to reproduce

  1. Create new project with create-puck-app
  2. Upgrade to 0.18 canary
  3. Switch to RSC render
  4. Add a component with a DropZone, like this -
import { type Config } from "@measured/puck";

type Props = {
  HeadingBlock: { title: string };
  Test: { title: string };
};

export const config: Config<Props> = {
  components: {
    HeadingBlock: {
      fields: {
        title: { type: "text" },
      },
      defaultProps: {
        title: "Heading",
      },
      render: ({ title }) => (
        <div style={{ padding: 64 }}>
          <h1>{title}</h1>
        </div>
      ),
    },
    Test: {
      fields: {
        title: { type: "text" },
      },
      defaultProps: {
        title: "Heading",
      },
      render: ({ puck: { renderDropZone } }) => {
        return <div>{renderDropZone({ zone: "test" })}</div>;
      },
    },
  },
};

export default config;

## What happened

A type error occurs:

TypeError: renderDropZone is not a function

And then hydration errors occur

What I expected to happen

No errors to occur

@chrisvxd chrisvxd added ready Assumed ready enough to start type: bug 🐛 labels Jan 9, 2025
@chrisvxd chrisvxd added this to the 0.18 milestone Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Assumed ready enough to start type: bug 🐛
Projects
None yet
Development

No branches or pull requests

1 participant