Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
2k views

This is the Error I'm getting //This is my code where I used the react lazy in React functional component. import React,{Suspense, lazy} from "react"; import { BrowserRouter, Routes, Route } ...
Vidhun's user avatar
  • 21
2 votes
1 answer
461 views

I am trying to refactor a React 18 app to use lazy loading as described in the docs: The best way to introduce code-splitting into your app is through the dynamic import() syntax. My original code (...
Patrick Kenny's user avatar
4 votes
1 answer
2k views

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
0 votes
0 answers
249 views

I create a portal component(InboxModal). and I want to show it when I click a button with lazy import. but when I call that I got this error: Failed to fetch dynamically imported module: http://127.0....
Hasan's user avatar
  • 1,001
3 votes
1 answer
940 views

I am using React.lazy to try to split off some code from my main application, but it's not working the way I expect and I'm having trouble figuring out how to debug. My code looks something like: // ...
mariaines's user avatar
  • 507
2 votes
0 answers
977 views

I'm trying to lazy import JSX models in React Three Fiber. I have a couple of JSX models which incorporate useGLTF() from drei, to load the actual .gltf/.glb model, as nodes and materials, like in the ...
Jakub Pabis's user avatar
1 vote
1 answer
827 views

I have Implemented using React.lazy and Suspense in react-native but it seems it does not working with react-native. I had followed This Youtube Video Basicaly I want to embed Youtube Player in react ...
Udbhav Vikram Singh's user avatar
14 votes
1 answer
5k views

I am using <React.Suspense> for data fetching like in this blog post. From the react docs Suspense lets your components wait for something before they can render. And even better explained in ...
hane Smitter's user avatar
2 votes
1 answer
178 views

UPDATE: I figured out what was happening and there was no way for anyone to answer because a lot of missing information - like where were the light and dark variable files being exported to. Answer, ...
mezzomix's user avatar
  • 325
1 vote
0 answers
395 views

I have a NAV header component called GlobalHeaderV2.tsx which has a Search component. Currently on page load both the components are being rendered increasing the page size. Search Component renders ...
Yeshwanth Kumar's user avatar
3 votes
0 answers
3k views

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
692 views

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
  • 347
3 votes
0 answers
2k views

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,597
1 vote
0 answers
299 views

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,113
0 votes
1 answer
3k views

Hi all I am new in Next/react I am trying to lazy load one component. What my expectation is that component must loads when it is visible in user view port or once a page is fully rendered. Its html ...
Vivek Singh's user avatar
1 vote
1 answer
1k views

I am facing one issue where my react app is not able to load the lazily loaded chunk(Error: loading chunk 0 failed). Upon checking, I found the chunk is being requested from the relative url that is ...
Aman Pandey's user avatar
1 vote
0 answers
473 views

We have a simple React application where the parent component (ShopItem) renders multiple child components (CommentCard) in a loop. const ShopItem = ({ item }) => { const [comments, setComments]...
Alex's user avatar
  • 1,496
4 votes
1 answer
3k views

I'm obviously quite confused about this but, I have a module FileAttachments which imports (and no one else does) a fair number of other sizeable modules. I'd expect that when I changed that import ...
Peter Gerdes's user avatar
  • 3,113
3 votes
2 answers
2k views

The problem is that when I start using React.lazy, input styles are not rendering correctly. With lazy I get default Antd input styles, not mine. What's the problem and how I can fix it? You can see ...
user avatar
1 vote
1 answer
885 views

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
0 answers
544 views

I'm trying to codesplit a react-map-gl Map component into its own chunk using Lazy,Suspense. This is my component. import 'mapbox-gl/dist/mapbox-gl.css' import React, {lazy, Suspense} from 'react' ...
straylightrunner's user avatar
1 vote
1 answer
2k views

I implemented lazy loading routes with lazy and suspense in order to reduce the main bundle size. However, I run into the issue that, when refreshing the page, the app always end up in the wildcard ...
Pierre Burton's user avatar
0 votes
1 answer
2k views

I'm new to react and is trying out the React.lazy and Suspense imports, and I just have to say, I love them!!! My website went from 45% in performance up to 50-60% and that is without optimizing ...
Marty's user avatar
  • 1
1 vote
1 answer
598 views

We have a React Webapp where every route is lazy loaded: const HomeScreen = React.lazy(() => import('../components/HomeScreen/HomeScreen')); This, as expected, generates various JS files during a ...
Guy's user avatar
  • 13.4k
4 votes
2 answers
4k views

I'm trying to add implement lazy loading in react app which works well in top-level routes. But I also want the <Suspense></Suspense> and provide a fallback for nested routes. According to ...
angel_dust's user avatar
3 votes
2 answers
2k views

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
2 votes
2 answers
3k views

I have a question regarding the React.lazy() feature. I developing a feature and i am stuck at a point. My scenario I have a set up where i am Loading bunch of components lazily using React.lazy() ...
Vikhyath Maiya's user avatar
3 votes
0 answers
717 views

So I am working on an ReactJs App which was using [email protected] in the Start. But Recently we have to update our App to the latest version of React. By Upgrading I am facing issue with React Lazy and ...
Muhammad Bilal's user avatar
1 vote
0 answers
410 views

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

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
1 answer
2k views

I have a ReactJS app built with react-lazy-load-image-component in order to improve performance. My code wraps components that take time to initialize with something like: <h2 className={styles....
Igor Shmukler's user avatar
1 vote
2 answers
2k views

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
0 votes
1 answer
530 views

From what I understand, React lazy will split your bundle into multiple files. Let's say I use lazy loading with React.router. If our server is set up to send the whole bundle through a GET request, ...
Oleks G's user avatar
  • 104
1 vote
3 answers
2k views

I am unit testing a component that makes use of react-lazyload to lazyload stuff. While rendering in my unit test, I noticed that the Lazyload is not rendering the content and its placeholder is being ...
Vishal's user avatar
  • 11k
2 votes
2 answers
9k views

TypeScript error when I'm trying to import one React component into another using React.lazy templates/BugReport/index.tsx import { useEffect, useContext } from 'react'; import BugReportStatic from '@...
Hayk Simonyan's user avatar
0 votes
0 answers
731 views

lazysizes seems to simple to use, but I can't get it to actually lazy load an image with react... it loads the bottom image thats out of the viewport before it's scrolled into view, as you can see in ...
benmneb's user avatar
  • 2,353
0 votes
1 answer
713 views

I try use React lazy and Suspense loading. I have simple login page and animation page for lazy loading. But if I refresh or open this page I cant see animation. But when write fallback = <p> ...
Feruz Atamyradow's user avatar
3 votes
0 answers
854 views

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
361 views

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
3 votes
5 answers
3k views

I have requirement where I need to load component from dynamic folders. For example I have following folders inside components components -default -component-one -component-two ...
scott's user avatar
  • 3,212
2 votes
2 answers
727 views

I have pages or large components that need to be rendered after the main page loads. I have them lazily loaded but am getting an error when I use in createElement(): LazyExoticComponent | ...
user avatar
0 votes
1 answer
520 views

So my React Lazy setup works great, I use Laravel Mix instead of the normale Webpack config. But after running, the (named) chunks are all put in the public folder, instead of the public/js folder. ...
Ramon's user avatar
  • 1
5 votes
0 answers
1k views

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
1 vote
1 answer
530 views

I have created one React App using npx create-react-app my-app cmd (React 17 version). Now Well, I just tried to replace a classic import Component from './Component' to const Component = React.lazy(...
Nainish Modi's user avatar
3 votes
2 answers
2k views

Is it possible to load a heavy module using React.lazy? I have a very heavy raw file parsed as string (around 10 mb) and I would like to lazy load it. After trying: const Module = React.lazy(() => ...
Rashomon's user avatar
  • 6,892
0 votes
0 answers
231 views

I'm a beginner to React and trying to use React.lazy but failed and it's not showing any error in console. Please help import React, {Suspense } from "react"; import { Route, NavLink, Switch,...
Kamal's user avatar
  • 2,180
0 votes
0 answers
1k views

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
334 views

(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,279
3 votes
2 answers
4k views

I want to run a JS function from a module that loaded asynchronously (that exposed by module federation) and to use the return value in a React component. For example, setting the visibility of some ...
Shlomy Z's user avatar
  • 359
1 vote
1 answer
666 views

I try to load dynamically in my dashboard using React.lazy() and Suspense component. It works really well with an hardcoded value, but not with a variable. I'm a little bit speechless right now. ...
Jonathan Anctil's user avatar