Skip to content

Instantly share code, notes, and snippets.

@cazetto
Created April 21, 2020 19:06
Show Gist options
  • Save cazetto/348b1e7315102ed18132b6cdad818758 to your computer and use it in GitHub Desktop.
Save cazetto/348b1e7315102ed18132b6cdad818758 to your computer and use it in GitHub Desktop.
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