Questions tagged [react-lazy-load]
95 questions
0
votes
1 answer
componentDidMount unexpectedly called after move from react-loadable to react.lazy
In my project I used to rely on react-loadable to do some code spliting, lazy loading together with react-router. Something like:
with
Component = Loadable({
loader: () => import(/* webpackChunkName: "Analyze" */…

sthenault
- 14,397
- 5
- 38
- 32
0
votes
0 answers
React Loadable (Lazy load) on 'load'?
I am very impressed with react loadable library here: https://github.com/jamiebuilds/react-loadable
But I am confused if this is beneficial if I use this on load (by calling setState after load event)
On all the examples/blogs I have read,…

Bilal Hussain
- 994
- 1
- 10
- 25
0
votes
1 answer
Is webpack necessary for react lazy loading?
I am confused with webpack usage, as webpack is dependency manager and creates a bundle but this is not happening in CoreUi template.
Means this coreUi template using React Lazy loading like const Login = React.lazy(() =>…

Ashwani Panwar
- 3,819
- 3
- 46
- 66
-1
votes
1 answer
I'm getting following error "Cannot read properties of undefined (reading 'then') at lazyInitializer at resolveLazy " while using React Lazy
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 } from "react-router-dom";
import Loader from…

Vidhun
- 11
- 3
-1
votes
1 answer
React: Dynamic import css
I am new to react. I want to import either "darkMode.css" or "lightMode.css" (to a class-based component) based on the value of props.
Imagine I have the below function (in the class based component):
cssName = () => (this.props.mode === "dark"?…

Yige Song
- 333
- 6
- 16