93 questions
0
votes
0
answers
54
views
React navigation loading freeze on heavy component
I have a problem with React Native navigation (Expo Router). I have a slow loading (initial rendering) component on one of the screens and every time I move to that screen, the app freezes before ...
1
vote
1
answer
77
views
React lazy components with poor internet connectivity and error boundaries: Failed import due to poor connectivity seems to be cached even when online
In an "offline-first" app (which optimistically updates local state and gracefully handles errors by rolling back local state changes, for example), some features may still require internet ...
0
votes
1
answer
52
views
Lazy and suspense not working for export route
I tried to lazy and suspense in my routes.js page.
import { Navigate, useRoutes } from 'react-router-dom';
import { lazy,Suspense } from 'react';
export default function Router() {
<Suspense ...
0
votes
1
answer
1k
views
Importing local json data using lazy load in next js
I have a locally stored json in my project, which is an array containing around 200+ items.
Example: data.js
const data = [
{
title: 1
},
{
title: 2
},
...
{
title: 200
}
];
...
0
votes
0
answers
132
views
React hide code from sources by lazy loading
Is it possible to have a portion of my code not visible in the sources tab of the developer tools at all, until the user logs in. I know about not deploying source maps, but in theory that can still ...
0
votes
1
answer
271
views
Can't lazy load my lib component - component doesn't exist on type
I am converting a component library to use type: module in the package.json along with reorganising the structure and I'm now seeing that I can't lazy load my component within another repo...
I am ...
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 ...
0
votes
0
answers
414
views
How to handle lazy loading error in react
I'm trying to handle errors in React.lazy, for that I made the following component to which I pass the load function as parameters:
import React, { useState, useEffect, ReactElement, ComponentType } ...
1
vote
0
answers
122
views
Can i use React lazy and React Transition Group together?
I have a question. Can I use React lazy with React Transition group? (for example load component with lazy and after loaded add animation)?
I would try do it in this sandbox: https://codesandbox.io/s/...
1
vote
1
answer
923
views
NX and react router lazy doesn't split bundle
I am trying to use react router with lazy loading. I still see the bundle being downloaded as one main.js. The router resides in an nx application and the routes that should be lazy loaded are in nx ...
3
votes
1
answer
207
views
Dynamically load components from server in React
Its not the common dynamic loading question. In our project, we do have some js files (with component) on the server and we want to load those components dynamically in the react app.
I know about the ...
1
vote
0
answers
529
views
react lazy with async dynamic imports causes wrong orders in deployment
I'm using react, typescript. This is part of my code using react lazy.
import {lazy} from 'react';
const LAZY_PANELS = {};
const PANELS = {
'home': () => import('./home'),
'settings': () => ...
1
vote
0
answers
446
views
React.lazy used in the Functional Component create a strange effect of keep loading
the page I want to navigate to .
const MobileHome = () => {
//these are the sub.components i want to display in this component
const ChatHome = React.lazy(() => import("./ChatHome")...
0
votes
1
answer
3k
views
Lazy Loading in React - improves first page load, but makes all other page loads less smooth because of subsequent loads
In our React application's App.js file, lazy loading components that are not needed on the initial page load definitely helps with the speed of our first page load. However, it also seems to have a ...
0
votes
1
answer
1k
views
I'm getting following error "Cannot read properties of undefined (reading 'then') at lazyInitializer at resolveLazy " while using React Lazy [closed]
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 } ...