Created
April 21, 2020 19:06
-
-
Save cazetto/348b1e7315102ed18132b6cdad818758 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { FC, ReactNode } from "react"; | |
interface ICardProps { | |
chindren: ReactNode; | |
} | |
type CardProps<P> = FC<P> & { | |
Header: ReactNode; | |
}; | |
const Card: CardProps<ICardProps> = ({ children }) => { | |
return <div>{children}</div>; | |
}; | |
interface CardHeaderProps { | |
title: string; | |
} | |
const CardHeader: FC<CardHeaderProps> = ({ title }) => { | |
return <header>{title}</header>; | |
}; | |
Card.Header = CardHeader; | |
export default Card; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment