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

Fix various type issues #99

Merged
merged 2 commits into from
Sep 22, 2023
Merged

Fix various type issues #99

merged 2 commits into from
Sep 22, 2023

Conversation

chrisvxd
Copy link
Member

@chrisvxd chrisvxd commented Sep 21, 2023

Fixes two type issues.

Add missing id type to render props

Currently the type definition for props being passed into the render() function for each component isn't specifying the id prop, even though it's always there. This adds it.

Error
image

Ensure types allow for nested arrays

The types don't currently allow users to nest arrays, even though Puck supports it.

Props

type Props = {
  MyComponent: {
    items: {
      subItems: { label: string }[];
    }[];
  };
};

Component

image

Error

image

@vercel
Copy link

vercel bot commented Sep 21, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
puck-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 22, 2023 2:49pm

@chrisvxd chrisvxd merged commit 06b145b into main Sep 22, 2023
2 checks passed
@chrisvxd chrisvxd deleted the fix-types branch September 22, 2023 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants