prop types

This commit is contained in:
Sergey Yarkov 2020-07-07 18:49:24 +03:00
parent 8345fbeb56
commit f15a73bd76
4 changed files with 25 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types'
import { useLocation } from '@reach/router'
import { Link } from 'gatsby'
import slugify from '../../../helpers/slugify'
@ -14,3 +15,7 @@ const CategoryItem = ({ title }) => {
export default CategoryItem
CategoryItem.propTypes = {
title: PropTypes.string
}

View File

@ -1,4 +1,5 @@
import React from 'react'
import PropTypes from 'prop-types'
const Search = ({ articlesLength }) => {
return (
@ -9,4 +10,8 @@ const Search = ({ articlesLength }) => {
)
}
export default Search
export default Search
Search.propTypes = {
articlesLength: PropTypes.number
}

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types'
import slugify from '../../helpers/slugify'
import Img from "gatsby-image"
import './Books.scss'
@ -17,4 +18,10 @@ const Books = ({ data: { edges } }) => {
)
}
export default Books
export default Books
Books.propTypes = {
data: PropTypes.shape({
edges: PropTypes.array
})
}

View File

@ -1,4 +1,5 @@
import React from 'react';
import PropTypes from 'prop-types'
import { Link } from 'gatsby'
import slugify from '../../../helpers/slugify'
@ -10,4 +11,8 @@ const BookItem = ({ title }) => {
)
}
export default BookItem
export default BookItem
BookItem.propTypes = {
title: PropTypes.string
}