Answers about react
Questions and answers from the Croct community about react.
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…
Where in my React tree should I put the CroctProvider?
just installed @croct/plug-react and I am not sure how high up the tree the provider actually needs to be. I have a few routes that read content and one that…
useContent suspends and blanks my whole page, how do I scope the Suspense boundary?
I have a single <Suspense> boundary wrapping the whole page, and every useContent call inside it suspends the entire view until all of the slots resolve. So…
Strapi backend with a plain React SPA, which Croct SDK and how do I avoid the flash?
our content lives in Strapi and the storefront is a plain React app on Vite, no Next anywhere in the stack. i want to add Croct for personalization but i keep…
useContent in our Remix + Sanity app blanks the component then swaps, expected?
We are on Remix 2.15 with @croct/plug-react 2.x, and the hero content is authored in Sanity. I wrapped our Sanity-driven hero in useContent('home-hero')…
VWO edits on our Storyblok React site keep getting wiped by re-renders
Our marketing team built a couple of tests in VWO's visual editor on our Storyblok-powered React site. The symptom is consistent: the edited headline or…
Two-person team drowning in self-hosted GrowthBook maintenance, what do React shops actually run?
CTO of a two-person startup. We self-host GrowthBook because it seemed free, and in a sense it is. The Docker stack, the warehouse plumbing, and the…
Croct React SDK throws about client logic during SSR in our custom server rendering
We have a hand-rolled Express SSR setup (fintech, so migrating frameworks is not quick) and rendering components that use Croct hooks on the server throws the…
Moving off client-side flags because of control flash in our React SPA, does a SPA even avoid this?
I do CRO at an agency. We ran an experiment for a client through PostHog feature flags in their React SPA and users visibly got the control for a beat before…
Users log into two accounts in two tabs and their sessions bleed together
B2B app, support agents routinely open two customer accounts side by side in separate tabs. Our support team can reliably reproduce cross-account…
VWO visual editor keeps breaking on our Sanity + React site, is this fixable?
Hello, I would appreciate advice on a recurring problem. Our stack: Sanity v3, React 18.2, Vite build with CSS modules. Marketing runs tests with the VWO…
Best practice for choosing server-side vs client-side content rendering?
I am standardizing a Next.js starter template for our agency and want to settle on a sensible default before we roll it out across client projects. Croct…