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

103
Views
React script rendering iframe in certain browsers but not others

I am making a website for a business in React and I need to load widgets (bookeo) on some of the pages. I followed this Stack post and used the useScript() function to load the widgets:

import { useEffect } from 'react';

const useScript = url => {
  useEffect(() => {
    const script = document.createElement('script');

    script.src = url;
    script.async = true;

    document.body.appendChild(script);

    return () => {
      document.body.removeChild(script);
    }
  }, [url]);
};

export default useScript;

The hook is then implemented as such:

<Grid item xs={12}>
  {useScript("https://bookeo.com/widget.js?a=***************")}
</Grid>

It works on all versions of Mozilla, but only some Chrome browsers (based on OS), and no Microsoft Edge browsers. Widget's code is always received by client, but iframe is not rendered to DOM on said browsers. However, when the widget is simply implemented as a script tag in the index.html file, the widget works on all browsers with no problems, although the obvious problem is that I can't control it's location.

about 4 years ago · Juan Pablo Isaza
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!