我有以下内容:
<MenuItem
primaryText={currentUserProfile.displayName || currentUserProfile.email}
onTouchTap={this.handleTouchTap}
leftIcon={<DropDownArrow color={textColor}/>}
rightIcon={<img src="{currentUserProfile.displayName}" alt="Me" />}
style={{color: textColor}}
/>
rightIcon没有工作,因为它已经在{}中}如何让变量在{}内工作?
由于
答案 0 :(得分:2)
您将网址指定为"{currentUserProfile.displayName}"
作为字符串文字。您应该使用rightIcon={<img src={currentUserProfile.displayName} alt="Me" />}
编辑: 注意你的引号。