Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 632 Bytes

invalid-styled-jsx-children.mdx

File metadata and controls

31 lines (23 loc) · 632 Bytes
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.

Useful Links