我得到了下面的代码:
function App() {
...
const [message, setMessage] = useState(false);
const styles = {
backgroundColor:'lightGray',
...
}
return (
<div>
<h1> style:{notification ? styles:{styles.backgroundColor:'red'}}>Test</h1>
</div>
)
}
我想实现的只是改变已经创建的样式的背景颜色属性。