Currently, I'm exchanging some lazy loaded routes, that uses functions wrapping "require" in favor of dynamic imports in combination of React.lazy and Suspense.
The problem is, although in development I see in the docs Metro will indeed lazy evaluate the lazy loaded modules, isn't clear that this will actually happen on production too:
"import() calls are supported out of the box. In React Native, using import() automatically splits your application code so that it loads faster during development, without affecting release builds."
So, it will not affect release builds because is retro compatible to require, or because instead of lazy loading it will statically load for production (in contrast to development)? The docs seems not much clear about it :/
I just need to ensure that the whole app will not be loaded at once on startup and change the current behaviour I'm achieving by using () => require() functions on my navigations.
Currently, I'm exchanging some lazy loaded routes, that uses functions wrapping "require" in favor of dynamic imports in combination of React.lazy and Suspense.
The problem is, although in development I see in the docs Metro will indeed lazy evaluate the lazy loaded modules, isn't clear that this will actually happen on production too:
"import() calls are supported out of the box. In React Native, using import() automatically splits your application code so that it loads faster during development, without affecting release builds."
from https://facebook.github.io/metro/docs/module-api/#import-dynamic-import
So, it will not affect release builds because is retro compatible to require, or because instead of lazy loading it will statically load for production (in contrast to development)? The docs seems not much clear about it :/
I just need to ensure that the whole app will not be loaded at once on startup and change the current behaviour I'm achieving by using
() => require()
functions on my navigations.Thanks in advance! :)