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",
  },
];
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