嘗試爲組件樣式創建變量時出現語法錯誤。我一遍又一遍地閱讀文檔,語法看起來很好......我錯過了什麼嗎?風格類中的語法錯誤React
語法錯誤:意外的令牌(8:14)
const heroStyle = {
height: 100%,
backgroundImage: "url('+ imgUrl +')",
backgroundSize: 'cover',
overflow: 'hidden',
}
<header className="masthead" style={ heroStyle }>
嘗試身高:「100%」 –