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

136
Vistas
Intentando implementar un script en React

Estoy tratando de insertar este script de vista comercial en mi proyecto de reacción: https://www.tradingview.com/widget/market-overview/

Este es mi componente:

 import React, { useEffect } from "react"; import "./LiveCoinWatch.css"; export default function LiveCoinWatch() { const src = "https://s3.tradingview.com/external-embedding/embed-widget-market-overview.js"; useEffect(() => { const script = document.createElement("script"); script.src = src; script.async = true; script.innerHTML = { colorTheme: "dark", dateRange: "1M", showChart: true, locale: "en", width: "100%", height: "100%", largeChartUrl: "", isTransparent: true, showSymbolLogo: true, showFloatingTooltip: false, plotLineColorGrowing: "rgba(255, 229, 153, 1)", plotLineColorFalling: "rgba(180, 167, 214, 1)", gridLineColor: "rgba(0, 0, 0, 0)", scaleFontColor: "rgba(120, 123, 134, 1)", belowLineFillColorGrowing: "rgba(180, 167, 214, 0.12)", belowLineFillColorFalling: "rgba(255, 229, 153, 0.12)", belowLineFillColorGrowingBottom: "rgba(41, 98, 255, 0)", belowLineFillColorFallingBottom: "rgba(41, 98, 255, 0)", symbolActiveColor: "rgba(217, 210, 233, 0.12)", tabs: [ { title: "TestPage", symbols: [ { s: "BITSTAMP:BTCUSD", } ], }, ], }; document.body.appendChild(script); return () => { document.body.removeChild(script); }; }, [src]); return ( <div class="tradingview-widget-container"> <div class="tradingview-widget-container__widget"></div> </div> ); }

Traté de obtener el elemento por identificación y eliminar a su hijo. Por cierto, no sé por qué debería eliminar el div secundario después de usar esto. Intenté crear un nuevo div y agregar y eliminar al niño, pero recibí este error:

 NotFoundError: Node.removeChild: The node to be removed is not a child of this node

¡Gracias a todos los que ayudarían!

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