Missing class properties transform求解决方法



  • 环境: Xcode9

    部分package.json配置
    react-native: "0.45.1"
    babel-preset-react-native: "2.0.1"
    babel-preset-latest: "^6.24.1"

    其中.babelrc设置
    "presets": ["react-native", "latest"]

    在iOS模拟器上报错:
    error: bundling: SyntaxError: /node_modules/react-native/Libraries/ART/ReactNativeART.js: Missing class properties transform.
    140 |
    141 | class Surface extends React.Component {

    142 | static childContextTypes = {
    | ^
    143 | isInSurface: PropTypes.bool,
    144 | };
    145 |

    求解决的方法?


  • administrators

    建议使用默认的.babelrc


登录后回复