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
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
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
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
1 vote
0 answers
329 views

React lazy() - lazy load component when sibling component is loaded

(Simplified example): I have Component A and Component B, which are sibling components and are both lazy-loaded in App.js: import { lazy, Suspense } from 'react'; const A = lazy(() => import('./A'))...
aryanm's user avatar
  • 1,259
2 votes
0 answers
1k views

React.lazy returning 404 error when attempting to lazy load components

I'm attempting to convert my React application to lazy load components dynamically to increase the Lighthouse performance score and have been following the React Code Splitting Documentation in order ...
Sean Moody's user avatar
18 votes
4 answers
6k views

Keep the current page rendered until the new page is loaded with React.lazy and React.Suspense

I'm using React router to render my different pages according to a specific url. Now I wanted to use React.lazy to lazy load all my page components: import React from "react"; import { ...
johannchopin's user avatar
  • 14.9k

15 30 50 per page