From 42fa8c382b18b4814bee86ad24ad90e5a48c4063 Mon Sep 17 00:00:00 2001 From: Manav Date: Fri, 3 Mar 2023 16:21:15 +0530 Subject: [PATCH] Switch to recommended React import https://github.com/facebook/react/pull/18102 https://twitter.com/dan_abramov/status/1308739731551858689 --- src/components/Column.tsx | 4 ++-- src/components/CustomHead.tsx | 2 +- src/pages/404.tsx | 2 +- src/pages/index.tsx | 2 +- src/templates/default.tsx | 3 +-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/Column.tsx b/src/components/Column.tsx index 83a77c05..6959ee91 100644 --- a/src/components/Column.tsx +++ b/src/components/Column.tsx @@ -1,7 +1,7 @@ -import React, { PropsWithChildren } from "react"; +import * as React from "react"; import styled from "styled-components"; -const Column: React.FC = ({ children }) => { +const Column: React.FC = ({ children }) => { return (
diff --git a/src/components/CustomHead.tsx b/src/components/CustomHead.tsx index 4f0dbbc4..9eacdd76 100644 --- a/src/components/CustomHead.tsx +++ b/src/components/CustomHead.tsx @@ -1,5 +1,5 @@ import { graphql, useStaticQuery } from "gatsby"; -import React from "react"; +import * as React from "react"; import { replaceNullsWithUndefineds } from "utils/replace-nulls"; interface CustomHeadProps { diff --git a/src/pages/404.tsx b/src/pages/404.tsx index 506d7b4e..25ea3cd5 100644 --- a/src/pages/404.tsx +++ b/src/pages/404.tsx @@ -1,6 +1,6 @@ import CustomHead from "components/CustomHead"; import { HeadFC, Link, PageProps } from "gatsby"; -import React from "react"; +import * as React from "react"; import styled from "styled-components"; const NotFoundPage: React.FC = () => { diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 1cbba805..02632afe 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; import type { HeadFC, PageProps } from "gatsby"; +import * as React from "react"; const items = [ { diff --git a/src/templates/default.tsx b/src/templates/default.tsx index 8c8869b6..12efc6b7 100644 --- a/src/templates/default.tsx +++ b/src/templates/default.tsx @@ -1,7 +1,6 @@ -import Column from "components/Column"; import CustomHead from "components/CustomHead"; import { graphql, HeadFC, PageProps } from "gatsby"; -import React from "react"; +import * as React from "react"; import styled from "styled-components"; import type { Context } from "types"; import { replaceNullsWithUndefineds } from "utils/replace-nulls";