如何使用React和ASP.net MVC的Material-UI

时间:2017-07-12 13:31:51

标签: asp.net asp.net-mvc reactjs material-ui material

可以使用Material-UI + React + ASP.net MVC吗? 我知道React.net和ASP.net MVC,但我无法想象如何将Material-UI集成到ASP.net MVC项目。

谢谢

2 个答案:

答案 0 :(得分:0)

您只需要将material ui集成到react中,然后在webpack中使用react创建一个捆绑包,然后在您{{1}中集成/导入该捆绑包}。多数民众赞成......

答案 1 :(得分:0)

react

中不需要webpack.ProvidePlugin

删除

 plugins: [
        new webpack.ProvidePlugin({
            React: "React", react: "React", "window.react": "React", "window.React": "React"
        }),
    ],

并删除它

 externals: {
        // Use external version of React (from CDN for client-side, or
        // bundled with ReactJS.NET for server-side)
        react: 'React'
    }

并需要在es2015

中添加presets
{
    test: /\.jsx$/,
    loader: 'babel-loader',
    exclude: /(node_modules|bower_components)/,
    query: {
        presets: ['es2015', 'react']
    }
}