F
F
frolldoll2018-03-18 18:37:58
React
frolldoll, 2018-03-18 18:37:58

How to insert THIS into REACT JS code?

How to insert the following code into a class in react :

<!-- TradingView Widget BEGIN -->
<div class="tradingview-widget-container">
  <div id="tradingview_6b9d5"></div>
  <div class="tradingview-widget-copyright"><a href="https://www.tradingview.com/symbols/NASDAQ-AAPL/" rel="noopener" target="_blank"><span class="blue-text">AAPL</span> <span class="blue-text">chart</span> by TradingView</a></div>
  <script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
  <script type="text/javascript">
  new TradingView.widget(
  {
  "autosize": true,
  "symbol": "NASDAQ:AAPL",
  "interval": "60",
  "timezone": "Etc/UTC",
  "theme": "Light",
  "style": "3",
  "locale": "en",
  "toolbar_bg": "#f1f3f6",
  "enable_publishing": false,
  "hide_top_toolbar": true,
  "save_image": false,
  "hideideas": true,
  "container_id": "tradingview_6b9d5"
}
  );
  </script>
</div>
<!-- TradingView Widget END -->
is it possible to insert a script tag at all? does it also have a function? or connect the script to html and just write this function in the react component?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Aleksandrovich, 2018-03-18
@frolldoll

I think this service was created for you
https://magic.reactjs.net/htmltojsx.htm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question