react#NamedExoticComponent TypeScript Examples
The following examples show how to use
react#NamedExoticComponent.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.tsx From easy-email with MIT License | 6 votes |
Stack = memo(function Stack({
children,
vertical,
spacing,
distribution,
alignment,
wrap,
}: StackProps) {
const className = classNames(
styles.Stack,
vertical && styles.vertical,
spacing && styles[variationName('spacing', spacing)],
distribution && styles[variationName('distribution', distribution)],
alignment && styles[variationName('alignment', alignment)],
wrap === false && styles.noWrap
);
const itemMarkup = elementChildren(children).map((child, index) => {
const props = { key: index };
return wrapWithComponent(child, Item, props);
});
return <div className={className}>{itemMarkup}</div>;
}) as NamedExoticComponent<StackProps> & {
Item: typeof Item;
}
Example #2
Source File: index.tsx From easy-email with MIT License | 6 votes |
Stack = memo(function Stack({
children,
vertical,
spacing,
distribution,
alignment,
wrap,
}: StackProps) {
const className = classNames(
styles.Stack,
vertical && styles.vertical,
spacing && styles[variationName('spacing', spacing)],
distribution && styles[variationName('distribution', distribution)],
alignment && styles[variationName('alignment', alignment)],
wrap === false && styles.noWrap,
);
const itemMarkup = elementChildren(children).map((child, index) => {
const props = { key: index };
return wrapWithComponent(child, Item, props);
});
return <div className={className}>{itemMarkup}</div>;
}) as NamedExoticComponent<StackProps> & {
Item: typeof Item;
}