React JSX: Access Props in Quotes in a Maped component list

I am trying to display profile images from a list of profiles using the indivdual's profile props but I can not reach the props in the setup for some reason. It works fine for the name and title but when I try to use the profileimage url as source it reads as undefined if I use the example from the answer here React JSX: Access Props in Quotes

<img className="image" src={`images/${this.props.image}`} />

this does not work for me when used in this code

 <ul className={styles.ListUl}> {this.props.clinicians.map(c => {
   return (              
     <li key={c.accountId}>
       <button onClick={this.handleSetIndividual.bind(this, c)}>
         <h4>{c.firstName} {c.lastName}</h4>
         <img src={`${c.profileImageUrl}`} alt="individualImage" height="100" width="100" />
        </button> </li>
     )}
   )}
 </ul> 

All other props work such as the names this just has to do with getting the src param access to those props.

using src={c.profileImageUrl} as you suggested was tried already and is read by the browser as absolutely nothing. As in there is no src param any more. like this:

<img alt="profileImage" height="100" width="100">

The way I did it src={`${c.profileImageUrl}`} is read as src="undefined" if I take the $ symbol off of it it reads src="c.profileImageUrl"

Thanks in advance for the help!

链接地址: http://www.djcxy.com/p/52096.html

上一篇: React道具:在JSX动态内容中使用HTML实体?

下一篇: React JSX:在Maped组件列表中的行情中访问道具