Search code examples
javascriptreact-nativebabeljstemplate-strings

'babelHelpers.taggedTemplateLiteral' is undefined in react native when using tagged template strings


I'm trying to use tagged template strings in react native app (rn version 0.16) like this

let i18n = function(){
       return 'should be fun';
   };
console.log(i18n`not fun`);

I get exception - 'babelHelpers.taggedTemplateLiteral' is undefined;

if I use just template string like:

console.log(`Fun`);

It is working.

Since 0.16 rn moved to babel 6 and may be it is not only rn specific. I have check packager and "babel-plugin-transform-es2015-template-literals" included.

Any idea?


Solution

  • I solve it by updating to RN 18.