yogeshtakeo / BFD36_files

0 stars 0 forks source link

Task 11 : Objects and Arrays #11

Open yogeshtakeo opened 12 months ago

yogeshtakeo commented 12 months ago

Full Stack Development Bootcamp - Objects and Arrays in React Vite

Task Description

In this task, you will work with objects and arrays in a React project created using Vite. Understanding how to manipulate data structures like objects and arrays is essential for building dynamic and interactive web applications. You will perform tasks involving data manipulation, rendering data in components, and practicing common operations with objects and arrays in a React context.

Prerequisites

Before you begin, ensure you have the following installed on your system:

Task Steps

Step 1: Set Up a React Project with Vite

  1. Open your terminal and navigate to the directory where you want to create your React project.

  2. Run the following command to create a new Vite project with React:

    create-vite my-react-objects-arrays --template react
  3. Navigate into your project directory:

    cd my-react-objects-arrays

Step 2: Data Preparation

  1. In your project directory, create a folder named data.
  2. Inside the data folder, create two JSON files: students.json and courses.json. Populate these JSON files with data. For example:

    students.json

    [
     {
       "id": 1,
       "name": "Alice",
       "age": 20,
       "courses": [1, 2]
     },
     {
       "id": 2,
       "name": "Bob",
       "age": 22,
       "courses": [2, 3]
     },
     // Add more student data...
    ]

    courses.json

    [
     {
       "id": 1,
       "name": "Mathematics",
       "instructor": "Dr. Smith"
     },
     {
       "id": 2,
       "name": "History",
       "instructor": "Prof. Johnson"
     },
     // Add more course data...
    ]

Step 3: Create React Components

  1. Create a new React component named StudentList.jsx in a suitable directory (e.g., src/components).
  2. Inside the StudentList.jsx component, import and use the data from the students.json file to render a list of students. Display their names, ages, and the courses they are enrolled in.

Step 4: Manipulate Data

  1. Create a new React component named CourseList.jsx in the src/components directory.
  2. Import and use the data from the courses.json file to render a list of courses. Display their names and instructors.
  3. Implement a feature to filter the courses based on instructor names. Create a filter input field that allows users to search for courses taught by a specific instructor.

Step 5: Advanced Task (Optional)

  1. Create a new React component named StudentDetails.jsx in the src/components directory.
  2. Implement a feature that allows users to click on a student's name in the StudentList to view their details, including the courses they are enrolled in.
  3. Use React Router to create routes for viewing student details.

Step 6: Style Your Components

  1. Use CSS or a CSS-in-JS library like Styled Components to style your components.
  2. Apply appropriate styles to make your student list, course list, and any other components visually appealing.

Step 7: Test Your Webpage

  1. Start the development server by running:

    npm run dev
  2. Open your web browser and navigate to http://localhost:3000 to see your React webpage with the student and course lists in action.

  3. Verify that data is correctly displayed and that any filtering or advanced features you implemented work as expected.

Task Completion

Congratulations! You've successfully completed the Objects and Arrays in React Vite task. You've practiced working with JSON data, rendering it in React components, and manipulating objects and arrays. These skills are essential for building dynamic web applications.

mbasnet123456 commented 11 months ago

Name: Manoj Basnet Task 11: Object and Arrays git: https://github.com/mbasnet123456/Objects-and-Arrays-.git

image
shantibasnet commented 11 months ago

Name :Shanti Basnet Task11: objects and Arrays URl: https://github.com/shantibasnet/Collab1/tree/shanti

image image
Madhv98 commented 11 months ago

Name: Madhav Dhital Task 11: object and array Github: https://github.com/Madhv98/task11.git

Screenshot 2023-09-19 at 5 23 15 PM Screenshot 2023-09-19 at 5 28 13 PM Screenshot 2023-09-19 at 5 29 47 PM Screenshot 2023-09-19 at 5 30 18 PM
raj-maharjan99 commented 11 months ago

Raj Kumar Maharjan Task 11: object and array Glink: https://github.com/samragi99/task11-object-array.git image

Narayanadhikari9 commented 11 months ago

Name: Narayan Adhikari Task 11: Objects and Arrays GitHub Url: https://github.com/Narayanadhikari9/ObjectsandArrays Task11(1) Task11(2) Task11(3) Task11(4) Task11(5) Task11(6)

Youngbikalp commented 11 months ago

Name: Bikalp Timalsina Task 11 : Objects and Arrays Git Url: https://github.com/Youngbikalp/Task-11-Objects-and-Arrays image image image image image image image image image

sansubed commented 11 months ago

Name: Santona Subedi Task 11: Objects and arrays github repo link: https://github.com/sansubed/ReactViteAppTask11.git Screenshot 2023-09-21 at 10 05 12 PM Screenshot 2023-09-21 at 10 05 22 PM Screenshot 2023-09-21 at 10 05 33 PM Screenshot 2023-09-21 at 10 05 40 PM Screenshot 2023-09-21 at 10 06 11 PM

raj-maharjan99 commented 11 months ago

task 11 Raj kumar maharjan image

ghost commented 10 months ago

Name: Prakash karki Task 11: Objects and array Screen Shot 2023-10-25 at 12 24 30 PM

aniltimalsina commented 10 months ago

Name: Anil Timalsina Task 11 : Objects and Arrays Github Link: https://github.com/aniltimalsina/objects-arrays.git

Screenshot 2023-11-12 at 7 01 02 PM Screenshot 2023-11-12 at 7 01 17 PM Screenshot 2023-11-12 at 7 02 11 PM Screenshot 2023-11-12 at 7 02 42 PM