Answers for "handling props in class components reactjs ijnterview questions"

0

handling props in class components reactjs ijnterview questions

class StudentInfo extends React.Component{
 constructor(props){
   super(props);
 }

 render(){
   return(
     <div className="main">
       <h2>{this.props.name}</h2>
       <h4>{this.props.rollNumber}</h4> 
     </div>
   )
 }
}
Posted by: Guest on May-21-2021
0

handling props in functional components reactjs ijnterview questions

function StudentInfo(props){
 return(
   <div className="main">
     <h2>{props.name}</h2>
     <h4>{props.rollNumber}</h4>
   </div>
 )
}
Posted by: Guest on May-21-2021

Code answers related to "handling props in class components reactjs ijnterview questions"

Code answers related to "Javascript"

Browse Popular Code Answers by Language