File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
apps/insights/src/components/PriceFeed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
3
import { useLogger } from "@pythnetwork/component-library/useLogger" ;
4
- import { useResizeObserver } from "@react-hookz/web" ;
4
+ import { useResizeObserver , useMountEffect } from "@react-hookz/web" ;
5
5
import type { IChartApi , ISeriesApi , UTCTimestamp } from "lightweight-charts" ;
6
6
import { LineSeries , LineStyle , createChart } from "lightweight-charts" ;
7
7
import { useTheme } from "next-themes" ;
@@ -101,10 +101,10 @@ const useChartElem = (symbol: string, feedId: string) => {
101
101
}
102
102
} , [ logger , symbol ] ) ;
103
103
104
- useEffect ( ( ) => {
104
+ useMountEffect ( ( ) => {
105
105
const chartElem = chartContainerRef . current ;
106
106
if ( chartElem === null ) {
107
- return ;
107
+ throw new Error ( "Chart element was null on mount" ) ;
108
108
} else {
109
109
const chart = createChart ( chartElem , {
110
110
layout : {
@@ -146,7 +146,7 @@ const useChartElem = (symbol: string, feedId: string) => {
146
146
chart . remove ( ) ;
147
147
} ;
148
148
}
149
- } , [ backfillData , priceFormatter ] ) ;
149
+ } ) ;
150
150
151
151
useEffect ( ( ) => {
152
152
if ( current && chartRef . current ) {
You can’t perform that action at this time.
0 commit comments