From 9d8f5804c84ee6f96623658cad3779e43c295113 Mon Sep 17 00:00:00 2001 From: etowahadams Date: Fri, 7 Jun 2024 11:36:34 -0400 Subject: [PATCH] feat: default reactive --- src/core/gosling-component.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/gosling-component.tsx b/src/core/gosling-component.tsx index f2c0f972..eaeb44bc 100644 --- a/src/core/gosling-component.tsx +++ b/src/core/gosling-component.tsx @@ -40,9 +40,7 @@ export interface GoslingCompProps { theme?: Theme; templates?: TemplateTrackDef[]; urlToFetchOptions?: UrlToFetchOptions; - experimental?: { - reactive?: boolean; - }; + reactive?: boolean; } export type GoslingRef = { @@ -51,6 +49,7 @@ export type GoslingRef = { }; export const GoslingComponent = forwardRef((props, ref) => { + const { reactive = true } = props; const [viewConfig, setViewConfig] = useState(); // Keeping track of whether the initial render has occured is important so the API works pr const [isInitialRender, setIsInitialRender] = useState(true); @@ -129,7 +128,7 @@ export const GoslingComponent = forwardRef((props, // Update the compiled view config const isMountedOnce = typeof viewConfig !== 'undefined'; - if (props.experimental?.reactive && isMountedOnce) { + if (reactive && isMountedOnce) { // Use API to update visualization. setTimeout(() => { preverseZoomStatus(