Skip to content

stringifySlot

const stringifySlot: (children) => string

Defined in: @storesynk/react/dist/stringify.d.ts:20

Render a Storesynk template to an HTML string for core’s server transform - the React equivalent of Astro.slots.render(). Unlike @storesynk/next, the static react-dom/server import is fine here: there is no RSC compiler to block it, and the server render helpers run in ordinary server modules (loaders / server functions).

Also imported by for its client-side render-once injection, so this module can land in a client bundle - renderToStaticMarkup resolves to react-dom’s browser server build there and produces the same bytes as SSR (hydration-safe by construction).

Templates must be static host elements (plain tags - no client components, no state, no event handlers): the output is injected once via dangerouslySetInnerHTML and the Storesynk engine mutates it afterwards, so React never manages that subtree. Strings pass through untouched (the no-build authoring path).

ReactNode | string

string