handling props in class components reactjs ijnterview questions

Solutions on MaxInterview for handling props in class components reactjs ijnterview questions by the best coders in the world

showing results for - "handling props in class components reactjs ijnterview questions"
Gautier
05 Nov 2017
1class StudentInfo extends React.Component{
2 constructor(props){
3   super(props);
4 }
5
6 render(){
7   return(
8     <div className="main">
9       <h2>{this.props.name}</h2>
10       <h4>{this.props.rollNumber}</h4> 
11     </div>
12   )
13 }
14}
15
Rayan
22 Sep 2020
1function StudentInfo(props){
2 return(
3   <div className="main">
4     <h2>{props.name}</h2>
5     <h4>{props.rollNumber}</h4>
6   </div>
7 )
8}
9