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
 },[])


Related Query

More Query from same tag