handling props in functional components reactjs ijnterview questions

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

showing results for - "handling props in functional components reactjs ijnterview questions"
Léonard
24 Jan 2017
1function StudentInfo(props){
2 return(
3   <div className="main">
4     <h2>{props.name}</h2>
5     <h4>{props.rollNumber}</h4>
6   </div>
7 )
8}
9
Brandon
31 Feb 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