From b1f95ba204d44f5fbe8368622611fab60bdaa910 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Sirois Date: Fri, 18 Sep 2020 19:39:12 -0400 Subject: [PATCH] refact: clean up useless PropsWithChildren type --- src/LocationProvider.tsx | 9 +++++---- src/components/Sidebar/index.tsx | 6 ++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/LocationProvider.tsx b/src/LocationProvider.tsx index b7eb316..8e10e69 100644 --- a/src/LocationProvider.tsx +++ b/src/LocationProvider.tsx @@ -1,5 +1,5 @@ import { WindowLocation } from "@reach/router" -import React, { FC, PropsWithChildren, useMemo } from "react" +import React, { FC, useMemo } from "react" function appendSlashToPath(path: string): string { return path.endsWith("/") ? path : `${path}/` @@ -26,9 +26,10 @@ export const LocationContext = React.createContext> = ({ children, location }) => { +export const LocationProvider: FC = ({ + children, + location, +}) => { const memoizedContextValue = useMemo( () => ({ location, diff --git a/src/components/Sidebar/index.tsx b/src/components/Sidebar/index.tsx index 9eee85c..a06425b 100644 --- a/src/components/Sidebar/index.tsx +++ b/src/components/Sidebar/index.tsx @@ -1,4 +1,4 @@ -import React, { FC, HTMLAttributes, PropsWithChildren } from "react" +import React, { FC, HTMLAttributes } from "react" import Scrollbar from "react-perfect-scrollbar" import "react-perfect-scrollbar/dist/css/styles.css" import cx from "classnames" @@ -17,9 +17,7 @@ const MenuItem: FC = ({ children, to }) => { ) } -export const Sidebar: FC>> = ( - props -) => { +export const Sidebar: FC> = (props) => { const { children, ...restProps } = props return (