Delivery details step
"Shawn, the next step is about providing various delivery options. For now, let's assume that the user can choose between Primary
delivery, meaning a next-day delivery, and Normal
delivery, meaning 3 - 4 days delivery. By default, the Primary
option must be selected. A user can choose the Normal
delivery option too. Can you try building this last step?" Mike asked.
// src/BookStore.js // Adding DeliveryDetails component var DeliveryDetails = React.createClass({ getInitialState() { return ( { deliveryOption: 'Primary' } ); }, handleChange(event) { this.setState({ deliveryOption: event.target.value}); }, handleSubmit(event) { event.preventDefault(); this.props.updateFormData(this.state); }, render() { return ( <div> <h1>Choose ...
Get ReactJS by Example - Building Modern Web Applications with React now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.