Closed
Description
Summary
The new <style>
page shows this snippet at the very top:
<style> p { color: red; } </style>
While it is totally valid in regular HTML, it does not work in JSX (would be nice if it did though).
Error
/src/App.js: Unexpected token, expected "}" (3:21)
1 | export default function App() {
2 | return (
> 3 | <style> p { color: red; } </style>
| ^
4 | );
5 | }
6 |
Page
https://react.dev/reference/react-dom/components/style
Details
I believe JSX requires this workaround:
<style>{` p { color: red; } `}</style>