i have this script tag which i have used in my react app :
<script type="text/javascript" src="http://url" async>
{
"interval": "1h",
"width": 425,
"isTransparent": false,
"height": 450,
"symbol": "BINANCE:BTCUSDT",
"showIntervalTabs": true,
"locale": "en",
"colorTheme": "light"
}
</script>
i have used it in react like this:
const useScript = (url) => {
useEffect(() => {
const script = document.createElement('script',{colorTheme: 'dark',interval: '1h'}, null);
script.src = url;
script.async = true;
// script.setAttribute("colorTheme","dark");
// script.setAttribute("interval","1h");
document.body.appendChild(script);
return () => {
document.body.removeChild(script);
}
}, [url]);
};
export default useScript;
and i call it inside my component, but i can't set parameters like "interval": "1h"
and it uses the default values.
how can i do that ?