How to configure react? for webpack3.10

module: {
    rules: [
        {
            test: /\.js$/,
            exclude: /(node_modules)/,
            use: {
                loader: "babel-loader",
                options: {
                    presets: ["env", "react"]
                }
            }
        }
    ]
},

webpack.config.js adds react to report an error in this way, but all the online methods have been tried but not solved. Webpack version 3.10, how to add react and load it with babel-loader?

May.22,2021

it took a lot of effort to install babel-preset-react

Menu