diff options
author | Vitaly Takmazov | 2018-10-24 13:57:25 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:53 +0300 |
commit | 9643826617928fd23722497a308fd8d24d873cd7 (patch) | |
tree | 1162578ce8a81ad8a0bafe5039fce42f1c2856af /vnext/src/index.js | |
parent | af97ac83afd3b8c3464285e6fc0ba179eecc1943 (diff) |
React 16.6: react-loadable -> React.lazy
Diffstat (limited to 'vnext/src/index.js')
-rw-r--r-- | vnext/src/index.js | 12 |
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')); |