1

I believe understand the syntactic differences between require and import. I extensively use import with default or partial module dependencies. However in the react-native main codebase require it is still being used.

I'd like to implement some kind of lazy-load or at least make the application loading faster, and I understand there might be some relationship between how modules are packed / imported and used to load module chunks into memory.

Can someone shed some light on this?

jsdario
  • 6,477
  • 7
  • 41
  • 75

1 Answers1

0

Latest React Native tutorials and examples use the new import syntax.

Require is ECMAScript 5, while import is the latest ES6 format used commonly now.

for Comparison refer: Using Node.js require vs. ES6 import/export

Victor
  • 4,171
  • 1
  • 29
  • 37