#427
fix(codegen): emit string props as JSX expressions
serializeProps()put strings in quoted JSX attributes, so quotes made the JSX invalid and backslashes and newlines changed the value.- String props are now emitted as JSX expressions like
title={"..."}, and the examples in the docs match. - Fixes #379.
Co-authored by @KennyMcSimpson, based on #383.
Before
The generated JSX fails to build for a label with quotes, and the page shows backslashes, newlines and & as different text.
https://github.com/user-attachments/assets/eaa796b5-cbc2-4b3d-a1e8-927a2cd064cd
After
The same labels build, and the page renders each one exactly as written.
https://github.com/user-attachments/assets/966d1b37-04ea-4f81-a912-0863d90bd941
Activity
4ctateapproved changes20d ago
The latest updates on your projects. Learn more about Vercel for GitHub.