From 5b22dfad66ef9bef1aef9037db7ba88d4e23f98c Mon Sep 17 00:00:00 2001 From: Jeffrey Phillips Date: Mon, 12 Feb 2024 09:22:48 -0500 Subject: [PATCH] fix(mobx): Configure mobx to isolate state --- packages/module/src/Visualization.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/module/src/Visualization.ts b/packages/module/src/Visualization.ts index b9857d0c..14bfb0a5 100644 --- a/packages/module/src/Visualization.ts +++ b/packages/module/src/Visualization.ts @@ -1,5 +1,5 @@ import { ComponentType } from 'react'; -import { action, computed, observable, makeObservable } from 'mobx'; +import { action, computed, observable, makeObservable, configure } from 'mobx'; import * as _ from 'lodash'; import { Controller, @@ -24,6 +24,9 @@ import { import defaultElementFactory from './elements/defaultElementFactory'; import Stateful from './utils/Stateful'; +// Configure MobX to isolate state, this allows for applications to use different versions of MobX +configure({ isolateGlobalState: true }); + export class Visualization extends Stateful implements Controller { elements: { [id: string]: GraphElement } = {};