Answers about slots
Questions and answers from the Croct community about slots.
A publish broke my React components, should I be pinning slot versions?
Someone on the content side published a schema change to a slot, and my React components immediately started reading fields that no longer matched what came…
Does each experiment variant count against my Croct slot quota?
planning a batch of experiments on our Storyblok site and I need to know if every variant of every block eats into the slot allowance. if a 4-variant test on…
Republishing a Strapi block schema changed my slot and broke the front end, how do I pin versions?
After I updated a slot's schema to add a field, the deployed app started reading unexpected content because my code was not pinned to any particular version.…
What is the cleanest way to render a personalized hero in an App Router server component?
wiring my first Croct slot into an App Router page. the hero is personalized and I want it to arrive already rendered, not pop in and swap after the page…
If I change a Sanity component's fields, does it break the mapped Croct slot?
We iterate on our Sanity component schemas fairly often, adding and renaming fields as the design evolves. My worry is that editing a component's fields…
Does the VTEX integration also render personalized content or just track events?
I installed the GTM tag and I can see the events arriving on the dashboard, so that part is working. But I am confused about how the personalized content…
A content publish broke my build because the slot type changed, how do I stop that?
A colleague published a schema change on one of our slots this morning, and my very next build started failing because the content shape had changed under me.…
Should I pin the slot version in fetchContent or is leaving it off fine?
Some examples use a slot id like home-hero@2 and others just the bare home-hero. What is the practical difference between the two? We publish content changes…
For personalized blocks, should the copy live in Sanity or in Croct?
I am designing how content is authored across our Sanity project and Croct, and I want to get the data model right before anyone starts building. My main…
Best way to get typed slot content in a TypeScript Hydrogen project?
Our Hydrogen storefront is strict TypeScript, no implicit any, and I would like slot content to be typed end to end rather than casting the fetch result to…
How do I get TypeScript types for the content a slot returns in React?
I am tired of treating slot content as any in my React components. Right now I destructure useContent('home-hero') and TypeScript has no idea what the fields…
How do I get the content from a slot properly typed in TypeScript?
wiring up content fetching and the content coming back is basically unknown, so I get no autocomplete and no safety on the fields. Right now I am casting it…