0

Can I use import syntax instead of require as suggested by react native docs

I assume both are same. If not why? Will that improve the performance of loading images?

Anantha kumar
  • 335
  • 2
  • 13

2 Answers2

3

Yes, the latest React Native tutorials use the new import syntax. The main difference is, import is ECMAScript 6(ES6) syntax and require is ECMAScript 5(ES5).

1

yes you can use import. require is old syntax and import is new one introduced in ES6.

avani kothari
  • 729
  • 5
  • 16