Friday, September 11, 2020

Passing props from component

 Today's we will understand how to pass props from component .


import React from "react";
//showquestion component is imported
import ShowQuestion from "./ShowQuestion";

const  question= [
  {
    title: "what is react",
  },

];

//functional component
const App = () => {
  return (
    <div>
//showquestion is a component that we have imported and we
//have passed props items
      <ShowQuestion question={question} />
    </div>
  );
};

export default App;

No comments:

Post a Comment