【问题标题】:ReactJS changing styles with const stringsReactJS 使用 const 字符串更改样式 【发布时间】:2022-12-16 16:07:30 【问题描述】: 您好我正在尝试使用 const 字符串更改组件的样式,但它不起作用。我可以知道为什么这种方法是错误的吗? 样式={{颜色:{newColor}}} 【问题讨论】: 标签: css reactjs 【解决方案1】: 无需再次使用括号 style={{ color: newColor }} 【讨论】: