fix(section): `Column` inside `Section`

Merged
CA
4y ago
+22-3

This PR implements the issue https://github.com/zenorocha/react-email/issues/309 suggestion in order to correctly manage Column components as children.

type ReactEmailChild = {
  type?: {
    displayName?: string;
  }
} & React.ReactNode;

...

const hasTdElement = (child: ReactEmailChild) => {
      return React.isValidElement(child) && (child.type === "td" || child.type.displayName === "Column");
    };