Created
October 15, 2022 16:09
-
-
Save dioxmio/e28c9da030248e93035ea2f120c3213a to your computer and use it in GitHub Desktop.
This file contains 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
// ✅ Creating multiple composable Components | |
function Dialog(props: DialogProps) { | |
... | |
} | |
function DialogTitle(props: DialogTitleProps) { | |
... | |
} | |
function DialogContent(props: DialogTitleProps) { | |
... | |
} | |
function DialogActions(props: DialogActionsProps) { | |
... | |
} | |
type AvengerProps = { | |
description: string; | |
name: string; | |
} | |
// ✅ Combining declarative components to a complex layout | |
function ShowAvenger({description, name}: AvengerProps) { | |
return ( | |
<Dialog> | |
<DialogTitle> | |
... | |
</DialogTitle> | |
<DialogContent> | |
... | |
</DialogContent> | |
<DialogActions> | |
... | |
</DialogActions> | |
</Dialog> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment