From fb6e2e8b5d5908175cda2bd0b564c2a0c8449ec6 Mon Sep 17 00:00:00 2001 From: Josh RosenHanst <9725825+joshrosenhanst@users.noreply.github.com> Date: Thu, 17 Oct 2019 02:21:25 -0400 Subject: [PATCH] React error fixes (#180) * fix className errors by replacing class= with className= in templates; remove unused imports * fix component key warning by adding the node.id key to the component --- app/src/components/bookcard.js | 13 ++++++------- app/src/components/header.js | 2 +- app/src/components/layout.js | 2 +- app/src/pages/index.js | 6 ++---- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/app/src/components/bookcard.js b/app/src/components/bookcard.js index 696f70a..f8bcd00 100644 --- a/app/src/components/bookcard.js +++ b/app/src/components/bookcard.js @@ -1,13 +1,12 @@ -import { Link } from "gatsby" import PropTypes from "prop-types" import React from "react" import StarRatings from 'react-star-ratings'; const BookCard = ({ book }) => ( -
- Sunset in the mountains -
-
{ book.title }
+
+ Sunset in the mountains +
+
{ book.title }
{ book.year } ( { book.author }

-
- {book.category} +
+ {book.category}
) diff --git a/app/src/components/header.js b/app/src/components/header.js index 304fccf..3a413f8 100644 --- a/app/src/components/header.js +++ b/app/src/components/header.js @@ -3,7 +3,7 @@ import PropTypes from "prop-types" import React from "react" const Header = ({ siteTitle }) => ( -
+

{ return ( <>
-
+
{children}