0

I got this error after updating react-native and react

I think this is right syntax, but I don't know why this error is shown:

 this.list = function(table, callback, wheredata = [],selection = '',extra = '') {

SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:387:25)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object. (/Users/apcrat/Documents/redux/delfoo_React/api/model/catalog/cuisine_route.js:7:12)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

1 Answers1

2

You need to compile your code with Babel.js to use Ecmascript 6 features or if you want to work on es5, you can do like this

Community
  • 1
  • 1
the_bluescreen
  • 3,126
  • 2
  • 18
  • 31