Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

Props - Specify html tags on component with props

0 votes
24 views
added Feb 10 in React by lcjr First Warrant Officer (8,030 points)
// ChildComponent
function NarrativeMainSectionBox(props) {
    return (
        <div className="section-card hover-box-parent">
          <div className="hover-box">
            <a 
              href="#"
              className="overlay"
            > 
            <img src={props.imgurl} />
          </div>
        </div>
    );
}
// ParentComponent
return (
    <div className="section-box"> 
      <ChildComponent imgurl="/images/1.png" />  
      <ChildComponent imgurl="/images/2.png" />
    </div>
);

 

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...