invalid-styled-jsx-children.mdx


title: 'Invalid styled-jsx children'

Why This Error Occurred

You have passed invalid children to a <style jsx> tag.

Possible Ways to Fix It

Make sure to only pass one child to the <style jsx> tag, typically a template literal.

const Component = () => (
  <div>
    <p>Red paragraph</p>
    <style jsx>{`
      p {
        color: red;
      }
    `}</style>
  </div>
)

Please see the links for more examples.

Rendered from the public repository vercel/next.js on GitHub; content belongs to its authors. Cached for up to an hour.

errors/invalid-styled-jsx-children.mdx · vercel/next.js | Docs MD