1. 程式人生 > >node+react 打包成功,控制臺報錯

node+react 打包成功,控制臺報錯

exc -- yarn nat ets using span efi define

控制臺報錯: ‘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 [email protected]

    npm install [email protected] --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

+-- [email protected]

So your answer is

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

    

node+react 打包成功,控制臺報錯