Friday, September 11, 2020

Accessing props

 In previous blog we have seen how to pass props. Now we will understand how to access those props by functional component.

import React from "react";
//we have passed props as a parameter in function component
const SelectQuestion = (props=> {
  return (
    <div>
//accessing props property question
     {props.question.title}
    </div>
  );
};

export default SelectQuestion;

No comments:

Post a Comment