Passing Data via Link Component using BrowserRouter in React - GeeksforGeeks (2024)

// Home.js

import React from "react";

import {

Component,

Fragment

} from "react"

import BookItem from "./BookItem"

import './Home.css'

import 'bootstrap/dist/css/bootstrap.css';

import {

Card,

CardHeader,

CardTitle,

Button,

CardFooter,

CardBody,

CardText

} from "reactstrap";

import {

Nav,

NavItem,

NavLink

} from "reactstrap";

import { Link } from "react-router-dom";

import Cart from './Cart';

const Home = ({ items, onHandleAddToCart,

onHandleCheckCartItem, clearCart }) => {

return (

<Fragment>

<div class='navigation_class'>

<Nav

card

justified

pills

>

<NavItem>

<NavLink href='/'>

Home

</NavLink>

</NavItem>

<NavItem>

<Link to='/cart'>

Cart

</Link>

</NavItem>

<NavItem>

<NavLink

onClick={() => onHandleCheckCartItem}>

Check Cart

</NavLink>

</NavItem>

</Nav>

</div>

<div>

{

//mapping a item in js

items.map((currentItem, index) => {

//alert('loop executed '+index)

return (

<Fragment>

<Card

className="my-2"

style={{

width: '97%',

margin: '20px'

}}

>

<CardHeader>

{currentItem.getName()}

</CardHeader>

<CardBody>

<CardTitle tag="h5">

{currentItem.getAuthor()}

</CardTitle>

<CardText>

Price : {currentItem.getPrice()}

</CardText>

<Button

onClick={() => onHandleAddToCart(index)}>

Add to Cart

</Button>

</CardBody>

<CardFooter>

</CardFooter>

</Card>

</Fragment>

)

})}

</div>

</Fragment>

)

}

export default Home;

Passing Data via Link Component using BrowserRouter in React - GeeksforGeeks (2024)
Top Articles
Got 11 Minutes? This Simple Plan Will Help You Tackle Your Debt
Positively Wealthy by Emma Mumford: 9781786784360 | PenguinRandomHouse.com: Books
Chatiw.ib
Myexperience Login Northwell
Rainbird Wiring Diagram
Craigslist Free Stuff Appleton Wisconsin
How Much Is 10000 Nickels
Sissy Hypno Gif
Craigslist Mexico Cancun
Lenscrafters Westchester Mall
Steve Strange - From Punk To New Romantic
Publix 147 Coral Way
Cube Combination Wiki Roblox
The Wicked Lady | Rotten Tomatoes
Builders Best Do It Center
2024 Non-Homestead Millage - Clarkston Community Schools
6th gen chevy camaro forumCamaro ZL1 Z28 SS LT Camaro forums, news, blog, reviews, wallpapers, pricing – Camaro5.com
How to Store Boiled Sweets
Conan Exiles Colored Crystal
Enterprise Car Sales Jacksonville Used Cars
979-200-6466
Spectrum Field Tech Salary
Willam Belli's Husband
Yard Goats Score
Scream Queens Parents Guide
Horn Rank
Prep Spotlight Tv Mn
Discord Nuker Bot Invite
Helpers Needed At Once Bug Fables
Tottenham Blog Aggregator
Ihs Hockey Systems
Craigslist Auburn Al
Motor Mounts
Greater Orangeburg
Swimgs Yuzzle Wuzzle Yups Wits Sadie Plant Tune 3 Tabs Winnie The Pooh Halloween Bob The Builder Christmas Autumns Cow Dog Pig Tim Cook’s Birthday Buff Work It Out Wombats Pineview Playtime Chronicles Day Of The Dead The Alpha Baa Baa Twinkle
O'reilly Auto Parts Ozark Distribution Center Stockton Photos
Foolproof Module 6 Test Answers
Smith And Wesson Nra Instructor Discount
Ktbs Payroll Login
South Bend Tribune Online
Promo Code Blackout Bingo 2023
[Teen Titans] Starfire In Heat - Chapter 1 - Umbrelloid - Teen Titans
Iupui Course Search
Funkin' on the Heights
Booknet.com Contract Marriage 2
Is Chanel West Coast Pregnant Due Date
Ciara Rose Scalia-Hirschman
De Donde Es El Area +63
Lake County Fl Trash Pickup Schedule
San Pedro Sula To Miami Google Flights
Latest Posts
Article information

Author: The Hon. Margery Christiansen

Last Updated:

Views: 6591

Rating: 5 / 5 (50 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: The Hon. Margery Christiansen

Birthday: 2000-07-07

Address: 5050 Breitenberg Knoll, New Robert, MI 45409

Phone: +2556892639372

Job: Investor Mining Engineer

Hobby: Sketching, Cosplaying, Glassblowing, Genealogy, Crocheting, Archery, Skateboarding

Introduction: My name is The Hon. Margery Christiansen, I am a bright, adorable, precious, inexpensive, gorgeous, comfortable, happy person who loves writing and wants to share my knowledge and understanding with you.