feat: provide Fragment component

Adds a new Fragment component that provides the same functionality as
React.Fragment. See issue #9 for details.

closes issue #9
This commit is contained in:
M. George Hansen 2020-06-04 11:25:34 -07:00
parent b112dc2d97
commit da241efb59
Signed by: mgeorgehansen
SSH key fingerprint: SHA256:JlIGiQLPyQ2RHTH3a2oVlb20Xkh9Glr8DUF4YTXHJxM
4 changed files with 43 additions and 4 deletions

View file

@ -44,3 +44,9 @@ export interface Component<P extends object = {}> {
}
): HTMLElement;
}
export const Fragment: Component<{}> = ({ children }) => ({
tag: "#fragment",
attributes: {},
children: children || [],
});