import React from 'react' import { BrowserRouter, Link, Route } from 'react-router-dom' // import * as BooksAPI from './BooksAPI' import Bookshelf from './Bookshelf' import { getAll } from './BooksAPI' import SearchPage from './SearchPage' import './App.css' class BooksApp extends React.Component { constructor() { super(); this.state = { books: [] } }; componentDidMount() { getAll().then((books) => { this.setState({ books }) }) } onSelectChange = (e) => { const id = e.target.name const shelf = e.target.value console.log(id, shelf) this.setState((prevState, id) => { prevState.filter(function(id == book.id) { }) }) } render() { return (
( )}/> ( )}/>
Add a book
) } } export default BooksApp