1+ import { observer } from "mobx-react" ;
12import PropTypes from "prop-types" ;
2- import React , { Suspense , useSyncExternalStore } from "react" ;
3+ import React , { Suspense } from "react" ;
4+ import { createRoot } from "react-dom/client" ;
5+ import Variables from "../Styles/variables.scss" ;
36import "./global.scss" ;
47import { Loader } from "./Loader" ;
58import { terriaStore } from "./terriaStore" ;
6- import Variables from "../Styles/variables.scss" ;
7- import { createRoot } from "react-dom/client" ;
89
910// Lazy load the entire TerriaUserInterface component
1011const LazyTerriaUserInterface = React . lazy ( ( ) =>
@@ -13,11 +14,8 @@ const LazyTerriaUserInterface = React.lazy(() =>
1314 } ) )
1415) ;
1516
16- const Root = ( { themeOverrides } ) => {
17- const { terria, viewState, status } = useSyncExternalStore (
18- terriaStore . subscribe ,
19- terriaStore . getSnapshot
20- ) ;
17+ const Root = observer ( ( { themeOverrides } ) => {
18+ const { terria, viewState, status } = terriaStore ;
2119
2220 if ( status === "loading" ) {
2321 return < Loader /> ;
@@ -32,7 +30,7 @@ const Root = ({ themeOverrides }) => {
3230 />
3331 </ Suspense >
3432 ) ;
35- } ;
33+ } ) ;
3634
3735Root . propTypes = {
3836 themeOverrides : PropTypes . object
0 commit comments