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

feat add basic blok information if not specified #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

npostulart
Copy link
Contributor

Adds default _uid field to unknown bloks. This is useful for blok iterations, e.g.

export default function Grid({ blok }: { blok: GridStoryblok }) {
  return (
    <div className="grid grid-cols-3" {...storyblokEditable(blok)}>
      {blok.columns?.map((nestedBlok) => (
        <StoryblokComponent blok={nestedBlok} key={nestedBlok._uid} />
      ))}
    </div>
  );
}

Otherwise _uid has to be typed if used with unknownAny=true.

@npostulart
Copy link
Contributor Author

I think an even better way would be a basic type which can be refered to. Didn't found out what the best approach would be yet.

@dohomi
Copy link
Owner

dohomi commented Feb 27, 2024

I would extend the config with a custom parser to make sure all components of interest are typed.

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