Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

234
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!