Tag Error: React JSX Style Tag Error on Render

Easy to do with es6 template strings (which allows line breaks). In your render method:

const css = `
    .my-element {
        background-color: #f00;
    }
`

return (
    <div class="my-element">
        <style>{css}</style>
        some content
    </div>
)

As for use case I’m doing this for a div with some checkboxes that I’m using for debugging, that I would like to contain within one file for easy removal later.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)