score:1
according to you the heavymodule
is not a react component
i have a very heavy raw file parsed as string (around 10 mb) and i would like to lazy load it
so you cannot use react.lazy()
. instead i would recommend to import the raw file only where you require it and then render that particular component lazily.
you can try this method :
useeffect(()=> {
import('./heavymodule').then(data=> {
// your code
},[])
Source: stackoverflow.com
Related Query
- Lazy load a module using React lazy?
- How to load npm module type definition in Monaco using Webpack and react create-react-app
- Share codebase using common Sdk module in create react app Reactjs application
- Using React within a dynamically loaded es module
- Load custom native component in react native using expo kit
- How to load a local video in React using webpack?
- React Native - How to load local image using the uri in Image Component?
- How do I load SVGs directly in my React component using webpack?
- Extract CSS from SCSS and deferred lazy load in React app
- Using React.js lazy loading when I navigate to a nested route the main bundle doesn't load
- How to load tinymce editor in React using local tinymce js
- Proper way to load WASM module in React for big files (more than 4kb)
- Why is react lazy adding time to first load
- React Tabs Lazy Load
- How to import everything from a module in react using es6?
- Unable to load a react module as node module
- Module not found error using Yarn 2 to link React components
- React ref using reactstrap Input Module doesn't have Value prop
- Dynamic Import and Lazy load React Components
- Can't load tflite custom model into web using react
- React Lazy Load useEffect
- React testing library to cover the lazy load
- How to lazy load a js file in React (for a multilingual app)
- Load CSS module in ReactJS + Typescript and react rewired
- Lazy load components in react
- How to create React App including Web3 using create-react-app? I am getting Module not found Error. BREAKING CHANGE: webpack < 5 used
- using react lazy in CRA with cssmodules causes chunks to have duplicate css in production
- Using webpack and url-loader to load inline images in React
- Getting "Unsafe attempt to load URL data:image/svg+xml..." in Safari using a through React component
- Why React PWA refetch lazy load chunks based on routes when offline
More Query from same tag
- 'Set' or 'Map' is undefined in IE9 ReactJs
- How to use spread operator for nested objects in react?
- React Beginner Question: Textfield Losing Focus On Update
- Adding validation to simple React + Typescript application
- define the length of data which is passes as a props in React?
- Gatsby createPages with single JSON file doesn't refresh data changes
- How to force a MaterialUI Expansion Panel not to be expanded
- Binding this to nested functions in React
- this.props working in console.log of child component, but not rendering
- Reduce vertical spacing between two heading tags
- Checkbox and state in React Js
- Component get's called without button click
- How to send next.js client side data to the express server?
- change styles dynamically with react memo
- React - Truncate markdown
- How to access material ui Expanded property in Expansion Panel
- React router private route with local storage?
- Trying to toggle the background color of a table row on hover using React, but nothing happens
- new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method
- Fetching single item vs fetching multiple items with Redux
- should I use shouldComponentupdate?
- Jest - mocking imported function from another file not working
- React select npm onBlur function returns An error
- Export to excel with React and SheetJS
- How to check window.innerWidth in React/Gatsby before the website will render?
- ReactJS: How to overlay a component on top of another component's element?
- I wish create 2 pages in Next.JS with pagination and args between the 2
- How do I make the slideshow buttons scroll through the images?
- Jest TypeError: e.preventDefault is not a function
- CK Editor Validation using React Hook Form