Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Material ui appBar iconStyleRight语法错误_Material Ui - Fatal编程技术网

Material ui appBar iconStyleRight语法错误

Material ui appBar iconStyleRight语法错误,material-ui,Material Ui,我有 不知道为什么。我尝试了许多组合,包括在元素中添加样式,该元素被忽略 如果能用正确的语法将此右图标显示为红色,我将不胜感激,这样我就可以理解如何将样式应用于我的图标。事实证明,解决方案是设置IconButton组件的iconStyle属性 此外,在我当前的material-ui.d.ts环境中,iconStyleRight属性的typedef被错误地设置为“string”,但应该是object,这加剧了问题 现在一切都好了 render() { return <AppBar s

我有

不知道为什么。我尝试了许多组合,包括在
元素中添加
样式,该元素被忽略


如果能用正确的语法将此右图标显示为红色,我将不胜感激,这样我就可以理解如何将样式应用于我的图标。

事实证明,解决方案是设置IconButton组件的iconStyle属性

此外,在我当前的material-ui.d.ts环境中,iconStyleRight属性的typedef被错误地设置为“string”,但应该是object,这加剧了问题

现在一切都好了

render() {
    return <AppBar style={{ position: "fixed" }} title={<span>my Title</span>}

        iconElementLeft={<IconButton><NavigationMenu /></IconButton>}
        iconStyleRight={{color:"red"}}
        iconElementRight={<IconButton><span className = "material-icons">account_circle</span></IconButton>}
        />
}
Type '{ [x: number]: undefined; color: any; }' is not assignable to type 'string'