// TradingViewWidget.jsx import React, { useEffect, useRef, memo } from 'react'; function TradingViewWidget() { const container = useRef(); useEffect( () => { const script = document.createElement("script"); script.src = "https://s3.tradingview.com/external-embedding/embed-widget-advanced-chart.js"; script.type = "text/javascript"; script.async = true; script.innerHTML = ` { "autosize": true, "symbol": "NASDAQ:AAPL", "interval": "240", "timezone": "Europe/Moscow", "theme": "light", "style": "1", "locale": "en", "backgroundColor": "rgba(255, 255, 255, 1)", "hide_legend": true, "allow_symbol_change": false, "calendar": false, "support_host": "https://www.tradingview.com" }`; container.current.appendChild(script); }, [] ); return (
); } export default memo(TradingViewWidget);