browser error ReferenceError: React is not defined
//login.js
import React from "react";
import { render } from "react-dom";
render(
<h1>test</h1>,
document.getElementById("root")
);
//webpack.config.js
test: /\.js$/,
exclude: path.resolve(__dirname, "node_modules"),
include: path.resolve(__dirname, "public/src"),
loader: "babel-loader",
query: { //babel
"presets": ["env", "react"]
}
...
new webpack.ProvidePlugin({
"React": "react",
})
the generated js also includes react, but still reports an error