Open tanmynguyen opened 8 years ago
same here
+1
+1
+1
+1 on this TransformError:
(Sorry, I'm not good at English) I've solved this problem.
I think the reason is: Note: If your react-native version is 0.16+, For now can't support mrn My RN version is 0.28, so this problem occurred.
The solution is:
"plugins": [
"transform-regenerator",
"syntax-flow"
],
"presets": [
"react", "es2015"
],
to this file. Finally like this;
.babelrc
{
"retainLines": true,
"compact": true,
"comments": false,
"sourceMaps": false,
"plugins": [
"transform-regenerator",
"syntax-flow"
],
"presets": [
"react", "es2015"
],
}
Before:
import React, {
Component,
StyleSheet,
PropTypes,
View,
Image
} from 'react-native';
After:
import React, {
PropTypes,
Component
} from 'react';
import {
StyleSheet,
View,
Image
} from 'react-native';
In other words, import React and {PropTypes, Component} from 'react', import others from 'react-native'.
Not finished. Delete "export default" before "class ViewName(e.g. Avatar)“. And add "module.exports = ViewName(e.g. Avatar);" to the end of the file.
The core of step 1 is babel, it changed a lot from babel 5 to babel6. The core of step 2 is RN, if you have a high version RN, some features or syntax changed, so it can not support mrn.
Well, finally I run the project on device successful. But I think my solution is not good, hope someone provide a better one.
It is still this issue !
Hi team! When i apply mrn in my project react-native (v0.25), then I build.... Help me, please!! Thanks!!!