From 9d8f5804c84ee6f96623658cad3779e43c295113 Mon Sep 17 00:00:00 2001 From: etowahadams Date: Fri, 7 Jun 2024 11:36:34 -0400 Subject: [PATCH 1/2] 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( From ca4cccb813459c10e444b9ab2f84f1201fb343e1 Mon Sep 17 00:00:00 2001 From: etowahadams Date: Fri, 7 Jun 2024 11:37:37 -0400 Subject: [PATCH 2/2] fix: make component in editor use default --- editor/Editor.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/editor/Editor.tsx b/editor/Editor.tsx index 8ce1de99..c681760e 100644 --- a/editor/Editor.tsx +++ b/editor/Editor.tsx @@ -1220,7 +1220,6 @@ function Editor(props: RouteComponentProps) { border={'none'} id={'goslig-component-root'} className={'goslig-component'} - experimental={{ reactive: true }} compiled={(_, h) => { setHg(h); }}