Skip to content

Commit 57212e1

Browse files
committed
fix #57
1 parent c362200 commit 57212e1

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-ts-tradingview-widgets",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "This is a React component library for TradingView Widgets. TypeScript is fully supported for every component!",
55
"main": "dist/index.js",
66
"scripts": {

src/components/Widget.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ const Widget: React.FC<WidgetProps> = ({
6363
};
6464
}, [ref, scriptHTML, type, scriptSRC]);
6565

66+
const containerKey = containerId || "tradingview_" + scriptHTML;
67+
6668
return (
6769
<div style={{ display: "contents" }}>
6870
{type === "Widget" || type === "MediumWidget" ? (
69-
<div id={containerId}>
71+
<div id={containerId} key={containerKey}>
7072
<div ref={ref} style={{ display: "contents" }} />
7173
</div>
7274
) : (
73-
<div ref={ref} style={{ display: "contents" }} />
75+
<div ref={ref} style={{ display: "contents" }} key={containerKey} />
7476
)}
7577
<Copyright
7678
href={copyrightProps.href}

0 commit comments

Comments
 (0)