Questions tagged [react-loadable]
137 questions
4
votes
2 answers
npm run build does not use proxy
I have a working react.js application, which works using npm start (app built using create-react-app).
When I try to run npm run build, it builds the application. I serve it using
serve -s build -l 3000
It loads the first dashboard page but does…

Avinash
- 416
- 1
- 9
- 22
4
votes
2 answers
Dynamic Imports - NextJS
I have a simple function which loads a script:
const creditCardScript = (
onReadyCB,
onErrorCB,
) => {
let script = document.createElement("script");
script.type = "text/javascript";
script.src = process.CREDIT_CARD_SCRIPT;
…

Avi Kaminetzky
- 1,489
- 2
- 19
- 42
4
votes
0 answers
Using react-loadable with renderToNodeStream
I'm new to the react-loadable library. I am wondering if it is possible to use React's renderToNodeStream instead of renderToString on the server.
server index.js:
/* code... */
const appWithRouter = (
…

Joe C
- 1,685
- 2
- 16
- 26
4
votes
3 answers
Dynamic path import for lazy loading of components using react-loadable
I am creating an app using create-react-app and lazy loading the component using react-loadable.
What I want to do is import dynamic paths for the loader object or the Loadable function of react-loadble module.
Code:
const LoadableComponent = path…

vhie
- 252
- 2
- 14
3
votes
1 answer
Can we split node modules library on route basis?
We have website on react and done code splitting using loadable, and all webpack optimizations. One thing is concerning we are using 70 npm library and It leads to make a big vendor chunks which we splitted using splitChunks webpack.
What If we have…

Amit Aslia
- 31
- 1
- 3
3
votes
1 answer
Jest tests fails in react-loadable
We have a component that loads with react-loadable, also inside the component we have child components that loads with react-loadable. The problem I face in jest is was not able to load the child components tried few suggestions from internet.…

Dinesh Gurumoorthy
- 31
- 2
3
votes
0 answers
How to use jest & enzyme to test code splitting (code splits at the routes level using react-loadable)
I have a React project where I am using react-loadable to split a code at the route level. I’m also using Redux to manage the app’s store.
What I'm looking for is the way I can use Jest & Enzyme in order to test my routes (for the routes I’m using…

Hsaido
- 125
- 12
3
votes
1 answer
How to use multiple react suspense fallbacks with reach router?
I'm using "@reach/router": "^1.2.1" and in my App.js file I've got a fallback component to show while my routes are loading:
}>
…

Simpleton
- 6,285
- 11
- 53
- 87
3
votes
1 answer
How to do Server Side Rendering in React With React Loadable and Fetching Data for Components (Like Next.js)?
How Can i have Next.js Like Data Fetching (getInitialProps) with React Router and React Loadable using Razzle. I had data fetching without react-loadable but without code splitting app bundle is too big and it's taking too long to load the page for…

Nima Arefi
- 61
- 9
3
votes
1 answer
Service worker with create react app js chunks was loaded wrongly
I am using Create react app and service worker. However, sometimes when I build a new version, some js chunks was still loaded from service worker which they are not supposed to? And instead of loading a js file, it actually loads a html. After…

Bruce Mu
- 893
- 11
- 22
3
votes
2 answers
React: Loadable is not working?
Hi I am new in react and I want to implement routing with Loadable, But Its not working Its showing blank page when either http://localhost:3000/user or http://localhost:3000/
Could you please correct me where I am doing wrong.
I am also…

Shubham Verma
- 8,783
- 6
- 58
- 79
3
votes
0 answers
React loadable unable to load component on every new build unless refresh the page
I've been facing this issue since a while, when ever I create new build in production I got load error unless I refresh the page. The service worker is getting updated fine but don't know whats going on.
I've been using the following…

Moeen Basra
- 733
- 4
- 18
3
votes
0 answers
React-Loadable skip rendering 'Loading Component'
I am trying to do code splitting in react router v4 using react-loadable.
What I intend to acheive is that not replace current view with the loading component instead keep whatever is currently rendered. and change state of the currently loaded…

Utkarsh Sopan
- 51
- 11
3
votes
0 answers
react loadable undefined json key
Im trying to use react loadable with server side rendering.
My babel plugins config
"plugins": [
"syntax-dynamic-import",
"dynamic-import-node",
"react-loadable/babel",
[
"import-inspector",
{
…

ewief
- 536
- 3
- 9
3
votes
1 answer
Prefetch based on route with React Loadable and React Router?
Im using React Router and React Loadable to code split my app based on route:
In App.js:
In…

Evanss
- 23,390
- 94
- 282
- 505