node+react 打包成功,控制台报错

控制台报错: 'ReactCurrentOwner' of undefined

解决办法:RN版本的问题。

    

As I mentioned, make sure you've installed the correct version of React. If you're using React Native 0.45:
yarn add react@16.0.0-alpha.12

    npm install react@16.0.0-alpha.12 --save-dev

    npm install --save-dev babel-preset-es2015

test:/.jsx?$/,
        exclude:/node_modules/,
        loader:'babel-loader',
        query:{
            presets:['es2015','react']
        }

  

Your config is

presets: ['es2015', 'react']

but the only preset you've installed is

+-- babel-preset-es2015@6.18.0

So your answer is

npm install --save-dev babel-preset-react

    

原文地址:https://www.cnblogs.com/detanx/p/errorSolute.html