HMR不使用`withStyle`

时间:2017-10-05 12:31:46

标签: reactjs material-ui webpack-hmr jss

使用Material-UI&withStyle, 在下面的示例中,当将颜色更改为Illuminate\Support\Collection Object ( [items:protected] => Array ( [0] => stdClass Object ( [CustomFieldName] => Laptop Brands [fieldValue] => HP,Lenovo ) [1] => stdClass Object ( [CustomFieldName] => Processor [fieldValue] => Core i5 ) [2] => stdClass Object ( [CustomFieldName] => RAM [fieldValue] => 4GB,8GB ) [3] => stdClass Object ( [CustomFieldName] => Storage Size [fieldValue] => 1TB ) ) ) 时,我在控制台上看到HMR正在更新模块,但更改实际上并未显示在屏幕上,我必须重新加载页面。 / p>

如果我向div添加blue属性并将颜色设置为style,则会在屏幕上正确显示。

blue

我认为我并不完全理解这个const styles = () => ({ root: { color: 'black', }, }); class Test extends React.Component { render() { const { classes } = this.props; return ( <div calssName={classes.root}> This is a test </div> ) } } const select = function (state) { return state; }; export default compose( withStyles(styles), connect(select), )(Test); 的事情,我的猜测是错误的配置因此我的withStyles

webpack.config.dev.js

0 个答案:

没有答案