Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

156
Vistas
embeded HTML doesn't show on react page

I am trying to ad some gofundme donation buttons on a react page but it doesn't even show on screen.

const Donation = () => {
    return (
        <div>
            <div className="gfm-embed" data-url="https://www.gofundme.com/f/theyre-the-real-victims/widget/large/"></div>
            <script defer src="https://www.gofundme.com/static/js/embed.js"></script>
        </div>
    )
}
    
export default Donation

I have neve done anything like this before. Any help will be appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

React uses innerHTML to add elements to the DOM. innerHTML disables execution of script tags.

HTML5 specifies that a tag inserted with innerHTML should not execute.

So, the recommended way to include script tags is via the useEffect hook

const Donation = () => {

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

    script.src = "https://www.gofundme.com/static/js/embed.js";
    script.async = true;

    document.body.appendChild(script);

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

    
  return (
   <div>
     <div className="gfm-embed" data-url="https://www.gofundme.com/f/theyre-the-real-victims/widget/large/"></div>
   </div>
  )
};

export default Donation
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda