ReactDOM.render出语法错误
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore } from 'redux'
import { Provider } from 'react-redux';
import App from './containers/App';
import todoApp from './Reducers/Reducers';
let store = createStore(todoApp);
let app = document.getElementById('app');
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
app
);
这代码为什么是语法错误?
2 回复
npm install babel-loader babel-core babel-preset-es2015 babel-preset-react --save-dev
module: {
loaders: [
{
test: /\.(jsx|js)$/,
loader: 'babel-loader',
exclude: /node_modules/,
query: {
presets: ['react', 'es2015']
}
}
]
},
@yuyang041060120 谢谢, 我的.babelrc 没拷贝过来…