dillon1000/react
Commit
Browse files Add doctype to renderToMarkup when html tags are rendered (#30122)
Stacked on top of #30121. This is the same thing we do for `renderToReadableStream` so that you don't have to manually inject it into the stream. The only reason we didn't for `renderToString` / `renderToStaticMarkup` was to preserve legacy behavior but since this is a new API we can change that. If you're rendering a partial it doesn't matter. This is likely what you'd do for RSS feeds. The question is if you can reliably rely on the doctype being used while rendering e-mails since many clients are so quirky. However, if you're careful it also doesn't hurt so it seems best to include it.
Changed paths3 files
First-parent comparisonpackages/react-html/src/ReactFizzConfigHTML.js ModifiedM packages/react-html/src/__tests__/ReactHTMLClient-test.js ModifiedM packages/react-html/src/__tests__/ReactHTMLServer-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…