From f40c34f3a365da672568c8ba39b25b5bd7c791ae Mon Sep 17 00:00:00 2001 From: Sumanth U <157620444+Sumanth077s@users.noreply.github.com> Date: Sun, 1 Dec 2024 05:54:38 +0530 Subject: [PATCH] Update App.js --- 04-accordion/final/src/App.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/04-accordion/final/src/App.js b/04-accordion/final/src/App.js index a291f9ec0..81c152558 100644 --- a/04-accordion/final/src/App.js +++ b/04-accordion/final/src/App.js @@ -1,15 +1,28 @@ +// Importing React and useState for component creation and state management import React, { useState } from 'react'; + +// Importing the data array from an external file import data from './data'; + +// Importing the SingleQuestion component to display individual questions import SingleQuestion from './Question'; + function App() { + // Initializing state to hold the questions data const [questions, setQuestions] = useState(data); + return (
+ {/* Page heading */}

questions and answers about login

+ + {/* Section to display the list of questions */}
+ {/* Mapping through the questions array to render each question */} {questions.map((question) => { return ( + // Rendering SingleQuestion component for each question with props spread ); })} @@ -19,4 +32,5 @@ function App() { ); } +// Exporting the App component as the default export export default App;