Add types for react and tsconfig

This commit is contained in:
supergrecko
2019-07-27 01:09:07 +02:00
parent 69fc1a3dbd
commit d2f9ffc2a3
6 changed files with 118 additions and 16 deletions
+5 -6
View File
@@ -1,11 +1,10 @@
import { Link } from "gatsby";
import PropTypes from "prop-types";
import React from "react";
import * as React from "react";
import icon from "./icon.png";
import { HeaderWrapper } from "./styles";
const Navbar = ({ siteTitle }) => (
// @todo maybe find alternative type for data
const Navbar = ({ siteTitle }: any) => (
<HeaderWrapper>
<div
style={{
@@ -34,11 +33,11 @@ const Navbar = ({ siteTitle }) => (
)
Navbar.propTypes = {
siteTitle: PropTypes.string,
siteTitle: String
}
Navbar.defaultProps = {
siteTitle: ``,
}
export default Navbar;
export default Navbar;
+3 -4
View File
@@ -1,5 +1,4 @@
import * as React from "react"
import PropTypes from "prop-types"
import React from "react"
import Helmet from "react-helmet"
import { useStaticQuery, graphql } from "gatsby"
@@ -67,9 +66,9 @@ const SEO = ({ description = "", lang = "en", meta = [], title }: SEOProps) => {
name: `twitter:description`,
content: metaDescription,
},
].concat(meta)}
]}
/>
)
}
};
export default SEO
+4 -3
View File
@@ -1,8 +1,9 @@
import * as React from "react";
import React from "react";
import { graphql } from "gatsby";
import Layout from "../components/Layout";
const LanguagePost = ({ data }) => {
// @todo maybe find alternative type for data
const LanguagePost = ({ data }: any) => {
const { html } = data.file.post;
console.log(data)
return (
@@ -26,4 +27,4 @@ export const query = graphql`
}
}
}
`
`