refact: standardize PropsWithChildren

This commit is contained in:
Jean-Philippe Sirois
2019-07-27 17:32:39 -04:00
parent 11ca0462e3
commit 57863ee926
3 changed files with 6 additions and 10 deletions
+2 -6
View File
@@ -1,11 +1,7 @@
import React from "react"
import React, { PropsWithChildren} from "react"
import * as SC from "./styles"
interface ContainerProps {
children: React.ReactNode
}
const Container = ({ children, ...restProps }: ContainerProps): JSX.Element => (
const Container = ({ children, ...restProps }: PropsWithChildren<{}>): JSX.Element => (
<SC.ContainerWrapper {...restProps}>{children}</SC.ContainerWrapper>
)
+2 -2
View File
@@ -1,4 +1,4 @@
import React from "react"
import React, { PropsWithChildren } from "react"
import * as SC from "./styles"
export interface DocsSidebarSectionProps {
@@ -8,7 +8,7 @@ export interface DocsSidebarSectionProps {
const DocsSidebarSection = ({
title,
children,
}: React.PropsWithChildren<DocsSidebarSectionProps>) => {
}: PropsWithChildren<DocsSidebarSectionProps>) => {
return (
<div>
<SC.SidebarTitle>{title}</SC.SidebarTitle>
+2 -2
View File
@@ -1,9 +1,9 @@
import React from "react"
import React, { PropsWithChildren } from "react"
import logo from "../../images/tph-logo.png"
import * as SC from "./styles"
import ArrowRight from "../../icons/arrow-right.svg"
function MenuItem({ children, to }: { children: React.ReactNode; to: string }) {
function MenuItem({ children, to }: PropsWithChildren<{ to: string }>) {
return (
<SC.MenuItem to={to}>
{children} <ArrowRight />