April 2018
Intermediate to advanced
298 pages
6h 34m
English
Under the Home link in the left-hand side navigation, there is a NewBook link. Clicking on this link will take you to the form that allows you to create a new book. Let's take a look at the NewBook component source now:
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createBook } from '../api';
import './NewBook.css';
class NewBook extends Component {
render() {
const {
title,
author,
imgURL,
controlsDisabled,
onTitleChange,
onAuthorChange,
onImageURLChange,
onCreateBook
} = this.props;
return (
<section className="NewBook">
<label>
Title:
<input
autoFocus
onChange={onTitleChange}
value={title}
disabled={controlsDisabled}
/>
</label>
<label>
Author:
<input onChange={onAuthorChange} ...