Lesson 2 - Build Form Profile App Using Multi-input Form Data
Building Form Profile App

Step-by-Step Procedure to Implement React Form Profile App
1. Setting Up the Project
Create a New React Project: Run the following command to create a new React project:
Install Bootstrap CSS: Install Bootstrap using npm:
Import Bootstrap in the
main.jsxfile:Setup Folder Structure: Create a
componentsfolder inside thesrcdirectory:
2. Implement the Parent Component: AppFormProfile.jsx
AppFormProfile.jsxThe parent component manages the state for the form data and profiles, and passes the necessary props to the child component.

Code for AppFormProfile.jsx:
3. Implement the Child Component: FormProfile.jsx
FormProfile.jsxThe child component receives props from the parent and renders the user profile.
Code for FormProfile.jsx:
4. Styling with Bootstrap
Leverage Bootstrap classes for styling. Use d-flex, flex-row, and flex-column for layouts. Add custom styles in App.css if necessary.
5. Run the Application
Start the application using the following command:
Final Output
The app will display a form at the top for adding profiles. Below the form, profiles will be displayed in a flexbox layout with images on the left and details on the right.
Summary
This walkthrough demonstrates how to:
Lift state up in the parent component.
Pass props to child components.
Use Bootstrap for responsive styling.
Manage forms and lists dynamically in React.
Challenge : Update the component to fetch image URLs from Unsplash and allow the user to select one.
apiKey for fetching data from pexels api page (https://api.pexels.com/v1/search?query=nature&per_page=15)
Code for Updated AppFormProfileUpdated.jsx:
3. Implement the Child Component: FormProfile.jsx
FormProfile.jsxThe child component receives props from the parent and renders the user profile.
Code for FormProfileUpdated.jsx
4. Styling with Bootstrap
Leverage Bootstrap classes for styling. Use d-flex, flex-row, and flex-column for layouts. Add custom styles in App.css if necessary.
5. Run the Application
Start the application using the following command:
Final Output
The app will display a form at the top for adding profiles. Below the form, profiles will be displayed in a flexbox layout with images on the left and details on the right.

Challenge : Capture Live Image from PC Camera
I want to modify App.jsx react component to capture the image data from the usb pc camera instead of using image URL.
Result
Summary
This walkthrough demonstrates how to:
Lift state up in the parent component.
Pass props to child components.
Use Bootstrap for responsive styling.
Dynamically fetch and display image options from an external API.
Manage forms and lists dynamically in React.
Last updated