Skip to Content
Full-Stack React Projects - Second Edition
book

Full-Stack React Projects - Second Edition

by Shama Hoque
April 2020
Intermediate to advanced
716 pages
18h 55m
English
Packt Publishing
Content preview from Full-Stack React Projects - Second Edition

The cart view

The cart view will contain the cart items and checkout details. But initially, only the cart details will be displayed until the user is ready to check out. The code to render this cart view will be added as follows.

mern-marketplace/client/cart/Cart.js:

<Grid container spacing={24}>      <Grid item xs={6} sm={6}>            <CartItems checkout={checkout}                  setCheckout={showCheckout}/>      </Grid> {checkout &&       <Grid item xs={6} sm={6}>        <Checkout/>      </Grid>}</Grid>

The CartItems component, which displays the items in the cart, is passed a checkout Boolean value and a state update method for this checkout value so that the Checkout component and its options can be rendered conditionally based on user interaction.

The showCheckout method to update the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Full-Stack React Projects

Full-Stack React Projects

Shama Hoque
React Native - The Practical Guide

React Native - The Practical Guide

Academind by Maximilian Schwarzmüller GmbH

Publisher Resources

ISBN: 9781839215414Supplemental Content