我有一个像这样的React组件:
import React from 'react';
import ReactDOM from 'react-dom';
class LayoutContainer extends React.Component {
render() {
return (
<div>asdas</div>
)}
}
ReactDOM.render(<LayoutContainer />, document.getElementById('gddmain'));
我创建了webpack配置文件:
var path = require("path");
var webpack = require("webpack");
const common_entry_point = path.resolve(__dirname, "resources", "assets");
module.exports = {
entry: {
home: path.resolve(common_entry_point, "react", "reactTest.js")
},
output: {
filename: "[name].js",
path: path.resolve(common_entry_point, "minjs")
},
module: {
loaders: [
{test:/.jsx?$/,loader:"babel-loader",exclude:"/node_modules/"}
]
},
resolve: {
extensions: [" ", ".", ".js", ".jsx", ".json"]
},
watch: true
}
第一,当我开始构建时,我收到错误
&#34; <LayoutContainer>
&#34;中出现意外错误。
我该如何渲染这个组件。