aboutsummaryrefslogtreecommitdiff
path: root/vnext/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-10-24 13:57:25 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commit9643826617928fd23722497a308fd8d24d873cd7 (patch)
tree1162578ce8a81ad8a0bafe5039fce42f1c2856af /vnext/src
parentaf97ac83afd3b8c3464285e6fc0ba179eecc1943 (diff)
React 16.6: react-loadable -> React.lazy
Diffstat (limited to 'vnext/src')
-rw-r--r--vnext/src/index.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/vnext/src/index.js b/vnext/src/index.js
index 1180d303..b64d2336 100644
--- a/vnext/src/index.js
+++ b/vnext/src/index.js
@@ -1,6 +1,5 @@
-import React from 'react';
+import React, { lazy, Suspense } from 'react';
import ReactDOM from 'react-dom';
-import Loadable from 'react-loadable';
function LoadingView(props) {
return (
@@ -23,13 +22,12 @@ function LoadingView(props) {
);
}
-const Juick = Loadable({
- loader: () => import('./App'),
- loading: LoadingView
-});
+const Juick = lazy(() => import('./App'));
const JuickApp = () => (
- <Juick />
+ <Suspense fallback={LoadingView}>
+ <Juick />
+ </Suspense>
);
ReactDOM.render(<JuickApp />, document.getElementById('body'));