Skip to content

Commit

Permalink
feat: default reactive
Browse files Browse the repository at this point in the history
  • Loading branch information
etowahadams committed Jun 7, 2024
1 parent c3169df commit 9d8f580
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/core/gosling-component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export interface GoslingCompProps {
theme?: Theme;
templates?: TemplateTrackDef[];
urlToFetchOptions?: UrlToFetchOptions;
experimental?: {
reactive?: boolean;
};
reactive?: boolean;
}

export type GoslingRef = {
Expand All @@ -51,6 +49,7 @@ export type GoslingRef = {
};

export const GoslingComponent = forwardRef<GoslingRef, GoslingCompProps>((props, ref) => {
const { reactive = true } = props;
const [viewConfig, setViewConfig] = useState<gosling.HiGlassSpec>();
// Keeping track of whether the initial render has occured is important so the API works pr
const [isInitialRender, setIsInitialRender] = useState(true);
Expand Down Expand Up @@ -129,7 +128,7 @@ export const GoslingComponent = forwardRef<GoslingRef, GoslingCompProps>((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(
Expand Down

0 comments on commit 9d8f580

Please sign in to comment.