Skip to content

Commit

Permalink
ensure mobx is configured before stores are instantiated (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
macfarlandian committed Jul 15, 2021
1 parent 2e892cf commit fbff379
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
11 changes: 10 additions & 1 deletion spotlight-client/src/DataStore/RootStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,20 @@
// =============================================================================

import { Auth0ClientOptions } from "@auth0/auth0-spa-js";
import { computed, makeObservable } from "mobx";
import { computed, configure, makeObservable } from "mobx";
import TenantStore from "./TenantStore";
import UiStore from "./UiStore";
import UserStore from "./UserStore";

configure({
// make proxies optional for IE 11 support
useProxies: "ifavailable",
// activate runtime linting
computedRequiresReaction: true,
reactionRequiresObservable: true,
observableRequiresReaction: true,
});

/**
* Returns the auth settings configured for the current environment, if any.
*/
Expand Down
10 changes: 0 additions & 10 deletions spotlight-client/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import "react-app-polyfill/ie11";
import "react-app-polyfill/stable";
import "intersection-observer";

import { configure } from "mobx";
import React from "react";
import ReactDOM from "react-dom";
import ReactModal from "react-modal";
Expand All @@ -28,15 +27,6 @@ import App from "./App";

smoothScroll.polyfill();

configure({
// make proxies optional for IE 11 support
useProxies: "ifavailable",
// activate runtime linting
computedRequiresReaction: true,
reactionRequiresObservable: true,
observableRequiresReaction: true,
});

ReactDOM.render(<App />, document.getElementById("root"), () => {
ReactModal.setAppElement("#root");
});

0 comments on commit fbff379

Please sign in to comment.