File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ function defaultChartOptions<TDatum>(
7070 interactionMode : options . interactionMode ?? 'primary' ,
7171 showVoronoi : options . showVoronoi ?? false ,
7272 defaultColors : options . defaultColors ?? defaultColorScheme ,
73- useIntersectionObserver : options . useIntersectionObserver ?? true ,
73+ useIntersectionObserver : options . useIntersectionObserver ?? false ,
7474 intersectionObserverRootMargin :
7575 options . intersectionObserverRootMargin ?? '1000px' ,
7676 primaryCursor : options . primaryCursor ?? true ,
@@ -162,7 +162,7 @@ export function Chart<TDatum>({
162162 }
163163 } , [ containerEl ] )
164164
165- const [ isIntersecting , setIsIntersecting ] = React . useState ( false )
165+ const [ isIntersecting , setIsIntersecting ] = React . useState ( true )
166166
167167 React . useEffect ( ( ) => {
168168 if ( ! containerEl || ! options . useIntersectionObserver ) return
@@ -208,9 +208,9 @@ export function Chart<TDatum>({
208208 height,
209209 } }
210210 >
211- { isIntersecting ? (
211+ { options . useIntersectionObserver && ! isIntersecting ? null : (
212212 < ChartInner options = { options } { ...{ width, height } } />
213- ) : null }
213+ ) }
214214 </ div >
215215 )
216216}
You can’t perform that action at this time.
0 commit comments