aboutsummaryrefslogtreecommitdiff
path: root/vnext
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
parentaf97ac83afd3b8c3464285e6fc0ba179eecc1943 (diff)
React 16.6: react-loadable -> React.lazy
Diffstat (limited to 'vnext')
-rw-r--r--vnext/package.json5
-rw-r--r--vnext/src/index.js12
-rw-r--r--vnext/yarn.lock13
3 files changed, 10 insertions, 20 deletions
diff --git a/vnext/package.json b/vnext/package.json
index ce1a43dd..b744c3b4 100644
--- a/vnext/package.json
+++ b/vnext/package.json
@@ -75,11 +75,10 @@
"immutability-helper": "^2.8.1",
"moment": "^2.22.2",
"query-string": "^6.2.0",
- "react": "^16.5.2",
+ "react": "16.6.0",
"react-content-loader": "^3.2.0",
"react-cookies": "^0.1.0",
- "react-dom": "^16.5.2",
- "react-loadable": "^5.5.0",
+ "react-dom": "16.6.0",
"react-router-dom": "^4.3.1"
}
}
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'));
diff --git a/vnext/yarn.lock b/vnext/yarn.lock
index 4be646c3..3bc92cf7 100644
--- a/vnext/yarn.lock
+++ b/vnext/yarn.lock
@@ -6850,7 +6850,7 @@ prompts@^0.1.9:
kleur "^2.0.1"
sisteransi "^0.1.1"
-prop-types@^15.5.0, prop-types@^15.6.1, prop-types@^15.6.2:
+prop-types@^15.6.1, prop-types@^15.6.2:
version "15.6.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
integrity sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==
@@ -7064,7 +7064,7 @@ react-dev-utils@^5.0.1:
strip-ansi "3.0.1"
text-table "0.2.0"
-react-dom@^16.5.2:
+react-dom@16.6.0:
version "16.6.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.6.0.tgz#6375b8391e019a632a89a0988bce85f0cc87a92f"
integrity sha512-Stm2D9dXEUUAQdvpvhvFj/DEXwC2PAL/RwEMhoN4dvvD2ikTlJegEXf97xryg88VIAU22ZAP7n842l+9BTz6+w==
@@ -7084,13 +7084,6 @@ react-is@^16.5.2, react-is@^16.6.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.6.0.tgz#456645144581a6e99f6816ae2bd24ee94bdd0c01"
integrity sha512-q8U7k0Fi7oxF1HvQgyBjPwDXeMplEsArnKt2iYhuIF86+GBbgLHdAmokL3XUFjTd7Q363OSNG55FOGUdONVn1g==
-react-loadable@^5.5.0:
- version "5.5.0"
- resolved "https://registry.yarnpkg.com/react-loadable/-/react-loadable-5.5.0.tgz#582251679d3da86c32aae2c8e689c59f1196d8c4"
- integrity sha512-C8Aui0ZpMd4KokxRdVAm2bQtI03k2RMRNzOB+IipV3yxFTSVICv7WoUr5L9ALB5BmKO1iHgZtWM8EvYG83otdg==
- dependencies:
- prop-types "^15.5.0"
-
react-router-dom@^4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-4.3.1.tgz#4c2619fc24c4fa87c9fd18f4fb4a43fe63fbd5c6"
@@ -7134,7 +7127,7 @@ react-test-renderer@^16.0.0-0, react-test-renderer@^16.5.2:
react-is "^16.6.0"
scheduler "^0.10.0"
-react@^16.5.2:
+react@16.6.0:
version "16.6.0"
resolved "https://registry.yarnpkg.com/react/-/react-16.6.0.tgz#b34761cfaf3e30f5508bc732fb4736730b7da246"
integrity sha512-zJPnx/jKtuOEXCbQ9BKaxDMxR0001/hzxXwYxG8septeyYGfsgAei6NgfbVgOhbY1WOP2o3VPs/E9HaN+9hV3Q==