reactjs - React Component Image Issue -


my image component won't seem put image in, url correct can add physically adding html page. component seems failing. tried found @ http://facebook.github.io/react/docs/jsx-in-depth.html#attribute-expressions did not help.

export default class mainlogo extends react.component {   render() {     return (       <div>         <img src = {'/src/app/assets/images/home/mainlogo.png'}/>       </div>     );   } } 

the class name should start capital letter (mainlogo) , shouldn't use {} on src, because sending img url directly src. it's not variable or state.

this should work:

export default class mainlogo extends react.component {   render() {     return (       <div>         <img src='/src/app/assets/images/home/mainlogo.png' />       </div>     );   } } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -