mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-08 04:55:06 +09:00
Closes https://github.com/webstudio-is/webstudio/issues/2966 ## Description Fixes visitor-facing crashes when a text binding resolves to a non-text value, such as an object returned from a resource. Generated expression children now render through `renderText`, which preserves strings and numbers and renders other runtime values as empty text. This prevents React SSR from throwing `Objects are not valid as a React child` when resource data shape changes unexpectedly. ## Changes - Added `renderText(value)` runtime helper. - Wrapped generated expression children with `renderText(...)`. - Updated generated page imports to include `renderText`. - Added rendering tests for resource status/error fields and object-shaped bindings. ## Tests ```bash pnpm --filter @webstudio-is/react-sdk test -- context.test.tsx component-generator.test.tsx pnpm --filter @webstudio-is/react-sdk typecheck pnpm --filter ./packages/cli typecheck
Webstudio SDK
Webstudio SDK is a TypeScript API that lets you use your Webstudio project or some components in your custom codebase or just render a complete Remix Document. It is currently under development, but feel free to play with the the current landing site