Help us understand the problem. What is going on with this article?

react-helmetでheadにインラインJavascriptを記述したい時のメモ

More than 1 year has passed since last update.

ほぼ、以下のコピペ。
React Helmet - Reference Guide

Javascriptの埋め込みは以下の通り。

<Helmet>
    <script type="application/javascript">{`
        {
            console.log("success!!");
        }
    `}</script>
</Helmet>

noscriptとかcss、構造化データも同様に埋め込み可。

<Helmet>
    <noscript>{`
        <link rel="stylesheet" type="text/css" href="foo.css" />
    `}</noscript>
</Helmet>
<Helmet>
    <style type="text/css">{`
        body {
            background-color: blue;
        }

        p {
            font-size: 12px;
        }
    `}</style>
</Helmet>
<Helmet>
    <script type="application/ld+json">{`
        {
            "@context": "http://schema.org"
        }
    `}</script>
</Helmet>
m3816
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away