Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

235
Visualizações
How to add javascript code snippet in react-helmet?

I am using react-helmet to push elements in the head. The code snippet that needs to be used is of GTM and e-commerce tracking. But, I'm not able to find a way to insert script in head anyway. The documentation shows for loading from external source. The code snippet has dynamic values that are being used.

The documentation is from tthis url : react-helmet

<Helmet script={[
                {src: "http://include.com/pathtojs.js", type: "text/javascript"},
                {type: "application/ld+json", innerHTML: `{ "@context": "http://schema.org" }`}
            ]}
/>
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

The documentation is correct. This works

<Helmet 
  script={[{ 
    type: 'text/javascript', 
    innerHTML: 'console.log("It works!")' 
  }]} />

Check your version of Helmet - the innerHTML attribute was introduced in Helmet 3.0.0

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda