Skip to main content

All Questions

1 vote
0 answers
455 views

React Suspense is not showing fallback second time component renders

I am doing some heavy operations inside field component and it is taking some time to render the component. So i am using react suspense to show loader. When i turn on editMode first time, able to see ...
muthu kumar's user avatar
4 votes
2 answers
2k views

Is it possible to dynamically import/lazy load a component from an URL that wasn't in the original build?

So I have a setup where I want to allow custom components to be created and referenced via an API fetch call made by my react client site. I know using dynamic imports and React.lazy these can be ...
Programmer Unextraordinair's user avatar
3 votes
0 answers
3k views

Chunk js file failing (404 Not found) for initial load only

I'm trying to implement code splitting using react JS + Next JS to reduce Initial load time of the page. But when I start my UI Service and try to run the webpage, a chunk file is created successfully ...
Sharanya M's user avatar
1 vote
2 answers
648 views

react-lazy-load-image-component Getting Error "TypeError: Cannot read properties of undefined (reading 'prototype')"

I'm using the React Testing Library, and when the component I'm rendering contains a LazyLoadImage from "react-lazy-load-image-component" I get the error "TypeError: Cannot read ...
Wisnu's user avatar
  • 337
3 votes
0 answers
2k views

React Lazy Import does not include CSS files

I have a react app setup with CRA. In my App.js I would load my css files, components and define my routes. import 'semantic-ui-css/semantic.min.css'; import './css/global.css'; import './index.css'; ...
Alk's user avatar
  • 5,577
1 vote
0 answers
277 views

How to override maxSize/priority for chunk named in dynamic import

I have a chunk I'm naming in a dynamic import as follows: const FileAttachments = React.lazy(() => import( /* webpackPrefetch: true */ /* webpackMode: "lazy" */ /* ...
Peter Gerdes's user avatar
  • 3,036
1 vote
1 answer
874 views

How can I import multiple functions or components from a package using react lazy

I have to replace the usage of loadable with react.lazy This is how it was with loadable: const loadReactIntl = () => import('react-intl'); export const intlProvider = () => Loadable({ loader:...
adabuyaman's user avatar
3 votes
2 answers
2k views

Is it possible to inject a variable value into a javascript comment?

TL;DR: is it possible to inject constant variables (that won't change during runtime) in comments I've come across a very unique situation where I need my comments to have a specific value in them. I'...
Barry Michael Doyle's user avatar
1 vote
0 answers
380 views

How to code split multiple React routes into one file?

I currently have the following lazy component imports: const LazyDashboard = React.lazy(() => import('./pages/app/Dashboard')); const LazyProfile = React.lazy(() => import('./pages/app/Profile'))...
Kevin Van Ryckegem's user avatar
1 vote
1 answer
1k views

When importing a module from node_modules that uses route based lazy loading in create-react-app, should code splitting work in the same way?

I used create-react-app (react ^17.0.2, react-scripts 4.0.3) to knock up a simple application which uses route based lazy loading to perform code splitting. When I build this application I see ...
SlyAtBest's user avatar
1 vote
2 answers
2k views

Testing lazily initialized components with Jest

I am trying to test my lazy initialized component, made with react-lazy-load-image-component using JestJS. Below are my tests: const viewModel = new VehicleViewModel(vehicleData, {}); const ...
Igor Shmukler's user avatar
3 votes
0 answers
824 views

React.lazy + Suspense or alternative?

in my app, I have two large components which include a lot of panels, and every panel has a few or more other components. Which takes a long time to render. I guess 1-2sec. A simple example of how ...
TomTom's user avatar
  • 41
0 votes
1 answer
359 views

React loadable issues

So the problem I am facing is this. When I load the page, the stylings of the Header component are not being rendered, but when I remove the load Logic they are. The problem might lie in Header ...
mura1's user avatar
  • 482
5 votes
0 answers
1k views

react lazy uncaught undefined Error occured

I'm trying to adopt react-lazy in my source. But I don't know what is wrong.. I Checked Two Things. Check export way of homeContainer Component. It's default export So It doesn't effect about using ...
young ban's user avatar
  • 169
0 votes
0 answers
1k views

Using React Leaflet with lazy loading

I am using React Leaflet. React and everything is working fine, but when I try to use React lazy loading the map just not render or render a small square as shown below. It is just a small box. <...
Mohamed Fawzy's user avatar

15 30 50 per page