From f63c1abfaf09129dcdd5856ea59d23185f5abb2e Mon Sep 17 00:00:00 2001 From: Carson Full Date: Fri, 11 Jul 2025 17:57:25 -0500 Subject: [PATCH] fix(react): React 19 JSX type namespace --- scripts/generate-mjml-react.ts | 2 +- src/mjml/Mjml.tsx | 2 +- src/mjml/MjmlAccordion.tsx | 2 +- src/mjml/MjmlAccordionElement.tsx | 2 +- src/mjml/MjmlAccordionText.tsx | 2 +- src/mjml/MjmlAccordionTitle.tsx | 2 +- src/mjml/MjmlAll.tsx | 2 +- src/mjml/MjmlAttributes.tsx | 2 +- src/mjml/MjmlBody.tsx | 5 ++++- src/mjml/MjmlBreakpoint.tsx | 2 +- src/mjml/MjmlButton.tsx | 2 +- src/mjml/MjmlCarousel.tsx | 2 +- src/mjml/MjmlCarouselImage.tsx | 2 +- src/mjml/MjmlClass.tsx | 2 +- src/mjml/MjmlColumn.tsx | 2 +- src/mjml/MjmlDivider.tsx | 2 +- src/mjml/MjmlFont.tsx | 5 ++++- src/mjml/MjmlGroup.tsx | 2 +- src/mjml/MjmlHead.tsx | 5 ++++- src/mjml/MjmlHero.tsx | 5 ++++- src/mjml/MjmlHtmlAttribute.tsx | 2 +- src/mjml/MjmlHtmlAttributes.tsx | 2 +- src/mjml/MjmlImage.tsx | 2 +- src/mjml/MjmlInclude.tsx | 2 +- src/mjml/MjmlNavbar.tsx | 2 +- src/mjml/MjmlNavbarLink.tsx | 2 +- src/mjml/MjmlPreview.tsx | 2 +- src/mjml/MjmlRaw.tsx | 5 ++++- src/mjml/MjmlSection.tsx | 2 +- src/mjml/MjmlSelector.tsx | 2 +- src/mjml/MjmlSocial.tsx | 2 +- src/mjml/MjmlSocialElement.tsx | 2 +- src/mjml/MjmlSpacer.tsx | 2 +- src/mjml/MjmlStyle.tsx | 2 +- src/mjml/MjmlTable.tsx | 2 +- src/mjml/MjmlText.tsx | 5 ++++- src/mjml/MjmlTitle.tsx | 2 +- src/mjml/MjmlWrapper.tsx | 2 +- 38 files changed, 56 insertions(+), 38 deletions(-) diff --git a/scripts/generate-mjml-react.ts b/scripts/generate-mjml-react.ts index 63e9165..71d99ed 100755 --- a/scripts/generate-mjml-react.ts +++ b/scripts/generate-mjml-react.ts @@ -185,7 +185,7 @@ export interface I${reactName}Props { ${types} } -export function ${reactName}(${props}: I${reactName}Props): JSX.Element { +export function ${reactName}(${props}: I${reactName}Props): React.JSX.Element { return React.createElement("${componentName}", ${createElementProps}); }; `; diff --git a/src/mjml/Mjml.tsx b/src/mjml/Mjml.tsx index 0312522..97fa19d 100644 --- a/src/mjml/Mjml.tsx +++ b/src/mjml/Mjml.tsx @@ -12,7 +12,7 @@ export interface IMjmlProps { lang?: string; } -export function Mjml({ children, ...props }: IMjmlProps): JSX.Element { +export function Mjml({ children, ...props }: IMjmlProps): React.JSX.Element { return React.createElement( "mjml", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlAccordion.tsx b/src/mjml/MjmlAccordion.tsx index ff3a761..c0e8c3d 100644 --- a/src/mjml/MjmlAccordion.tsx +++ b/src/mjml/MjmlAccordion.tsx @@ -34,7 +34,7 @@ export interface IMjmlAccordionProps { export function MjmlAccordion({ children, ...props -}: IMjmlAccordionProps): JSX.Element { +}: IMjmlAccordionProps): React.JSX.Element { return React.createElement( "mj-accordion", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlAccordionElement.tsx b/src/mjml/MjmlAccordionElement.tsx index b618e4a..3a72d64 100644 --- a/src/mjml/MjmlAccordionElement.tsx +++ b/src/mjml/MjmlAccordionElement.tsx @@ -27,7 +27,7 @@ export interface IMjmlAccordionElementProps { export function MjmlAccordionElement({ children, ...props -}: IMjmlAccordionElementProps): JSX.Element { +}: IMjmlAccordionElementProps): React.JSX.Element { return React.createElement( "mj-accordion-element", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlAccordionText.tsx b/src/mjml/MjmlAccordionText.tsx index cbb1902..af345da 100644 --- a/src/mjml/MjmlAccordionText.tsx +++ b/src/mjml/MjmlAccordionText.tsx @@ -30,7 +30,7 @@ export interface IMjmlAccordionTextProps { export function MjmlAccordionText({ children, ...props -}: IMjmlAccordionTextProps): JSX.Element { +}: IMjmlAccordionTextProps): React.JSX.Element { return React.createElement( "mj-accordion-text", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlAccordionTitle.tsx b/src/mjml/MjmlAccordionTitle.tsx index 610c787..e06e843 100644 --- a/src/mjml/MjmlAccordionTitle.tsx +++ b/src/mjml/MjmlAccordionTitle.tsx @@ -27,7 +27,7 @@ export interface IMjmlAccordionTitleProps { export function MjmlAccordionTitle({ children, ...props -}: IMjmlAccordionTitleProps): JSX.Element { +}: IMjmlAccordionTitleProps): React.JSX.Element { return React.createElement( "mj-accordion-title", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlAll.tsx b/src/mjml/MjmlAll.tsx index fdeb27a..a94f597 100644 --- a/src/mjml/MjmlAll.tsx +++ b/src/mjml/MjmlAll.tsx @@ -13,6 +13,6 @@ export interface IMjmlAllProps { [prop: string]: string | undefined; } -export function MjmlAll(props: IMjmlAllProps): JSX.Element { +export function MjmlAll(props: IMjmlAllProps): React.JSX.Element { return React.createElement("mj-all", convertPropsToMjmlAttributes(props)); } diff --git a/src/mjml/MjmlAttributes.tsx b/src/mjml/MjmlAttributes.tsx index 48e432c..34df426 100644 --- a/src/mjml/MjmlAttributes.tsx +++ b/src/mjml/MjmlAttributes.tsx @@ -16,7 +16,7 @@ export interface IMjmlAttributesProps { export function MjmlAttributes({ children, ...props -}: IMjmlAttributesProps): JSX.Element { +}: IMjmlAttributesProps): React.JSX.Element { return React.createElement( "mj-attributes", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlBody.tsx b/src/mjml/MjmlBody.tsx index 79935a6..590d17e 100644 --- a/src/mjml/MjmlBody.tsx +++ b/src/mjml/MjmlBody.tsx @@ -16,7 +16,10 @@ export interface IMjmlBodyProps { children?: React.ReactNode; } -export function MjmlBody({ children, ...props }: IMjmlBodyProps): JSX.Element { +export function MjmlBody({ + children, + ...props +}: IMjmlBodyProps): React.JSX.Element { return React.createElement( "mj-body", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlBreakpoint.tsx b/src/mjml/MjmlBreakpoint.tsx index a193565..a92d6eb 100644 --- a/src/mjml/MjmlBreakpoint.tsx +++ b/src/mjml/MjmlBreakpoint.tsx @@ -11,7 +11,7 @@ export interface IMjmlBreakpointProps { dangerouslySetInnerHTML?: { __html: string }; } -export function MjmlBreakpoint(props: IMjmlBreakpointProps): JSX.Element { +export function MjmlBreakpoint(props: IMjmlBreakpointProps): React.JSX.Element { return React.createElement( "mj-breakpoint", convertPropsToMjmlAttributes(props) diff --git a/src/mjml/MjmlButton.tsx b/src/mjml/MjmlButton.tsx index d364133..41530e0 100644 --- a/src/mjml/MjmlButton.tsx +++ b/src/mjml/MjmlButton.tsx @@ -55,7 +55,7 @@ export interface IMjmlButtonProps { export function MjmlButton({ children, ...props -}: IMjmlButtonProps): JSX.Element { +}: IMjmlButtonProps): React.JSX.Element { return React.createElement( "mj-button", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlCarousel.tsx b/src/mjml/MjmlCarousel.tsx index d998e0a..61a26dc 100644 --- a/src/mjml/MjmlCarousel.tsx +++ b/src/mjml/MjmlCarousel.tsx @@ -35,7 +35,7 @@ export interface IMjmlCarouselProps { export function MjmlCarousel({ children, ...props -}: IMjmlCarouselProps): JSX.Element { +}: IMjmlCarouselProps): React.JSX.Element { return React.createElement( "mj-carousel", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlCarouselImage.tsx b/src/mjml/MjmlCarouselImage.tsx index b6b77ce..d068a73 100644 --- a/src/mjml/MjmlCarouselImage.tsx +++ b/src/mjml/MjmlCarouselImage.tsx @@ -28,7 +28,7 @@ export interface IMjmlCarouselImageProps { export function MjmlCarouselImage({ children, ...props -}: IMjmlCarouselImageProps): JSX.Element { +}: IMjmlCarouselImageProps): React.JSX.Element { return React.createElement( "mj-carousel-image", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlClass.tsx b/src/mjml/MjmlClass.tsx index bda368a..a656fcb 100644 --- a/src/mjml/MjmlClass.tsx +++ b/src/mjml/MjmlClass.tsx @@ -11,6 +11,6 @@ export interface IMjmlClassProps { [prop: string]: string | undefined; } -export function MjmlClass(props: IMjmlClassProps): JSX.Element { +export function MjmlClass(props: IMjmlClassProps): React.JSX.Element { return React.createElement("mj-class", convertPropsToMjmlAttributes(props)); } diff --git a/src/mjml/MjmlColumn.tsx b/src/mjml/MjmlColumn.tsx index df9a142..c1ccc39 100644 --- a/src/mjml/MjmlColumn.tsx +++ b/src/mjml/MjmlColumn.tsx @@ -39,7 +39,7 @@ export interface IMjmlColumnProps { export function MjmlColumn({ children, ...props -}: IMjmlColumnProps): JSX.Element { +}: IMjmlColumnProps): React.JSX.Element { return React.createElement( "mj-column", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlDivider.tsx b/src/mjml/MjmlDivider.tsx index a04aa86..2f6c2f1 100644 --- a/src/mjml/MjmlDivider.tsx +++ b/src/mjml/MjmlDivider.tsx @@ -26,6 +26,6 @@ export interface IMjmlDividerProps { mjmlClass?: string; } -export function MjmlDivider(props: IMjmlDividerProps): JSX.Element { +export function MjmlDivider(props: IMjmlDividerProps): React.JSX.Element { return React.createElement("mj-divider", convertPropsToMjmlAttributes(props)); } diff --git a/src/mjml/MjmlFont.tsx b/src/mjml/MjmlFont.tsx index ddb79f5..54b0d0e 100644 --- a/src/mjml/MjmlFont.tsx +++ b/src/mjml/MjmlFont.tsx @@ -15,7 +15,10 @@ export interface IMjmlFontProps { children?: React.ReactNode; } -export function MjmlFont({ children, ...props }: IMjmlFontProps): JSX.Element { +export function MjmlFont({ + children, + ...props +}: IMjmlFontProps): React.JSX.Element { return React.createElement( "mj-font", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlGroup.tsx b/src/mjml/MjmlGroup.tsx index dbdedd8..a164ac3 100644 --- a/src/mjml/MjmlGroup.tsx +++ b/src/mjml/MjmlGroup.tsx @@ -21,7 +21,7 @@ export interface IMjmlGroupProps { export function MjmlGroup({ children, ...props -}: IMjmlGroupProps): JSX.Element { +}: IMjmlGroupProps): React.JSX.Element { return React.createElement( "mj-group", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlHead.tsx b/src/mjml/MjmlHead.tsx index 0bc7589..73f846b 100644 --- a/src/mjml/MjmlHead.tsx +++ b/src/mjml/MjmlHead.tsx @@ -13,7 +13,10 @@ export interface IMjmlHeadProps { children?: React.ReactNode; } -export function MjmlHead({ children, ...props }: IMjmlHeadProps): JSX.Element { +export function MjmlHead({ + children, + ...props +}: IMjmlHeadProps): React.JSX.Element { return React.createElement( "mj-head", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlHero.tsx b/src/mjml/MjmlHero.tsx index d00daec..a5d3131 100644 --- a/src/mjml/MjmlHero.tsx +++ b/src/mjml/MjmlHero.tsx @@ -37,7 +37,10 @@ export interface IMjmlHeroProps { children?: React.ReactNode; } -export function MjmlHero({ children, ...props }: IMjmlHeroProps): JSX.Element { +export function MjmlHero({ + children, + ...props +}: IMjmlHeroProps): React.JSX.Element { return React.createElement( "mj-hero", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlHtmlAttribute.tsx b/src/mjml/MjmlHtmlAttribute.tsx index ea3e2a1..15f88d6 100644 --- a/src/mjml/MjmlHtmlAttribute.tsx +++ b/src/mjml/MjmlHtmlAttribute.tsx @@ -14,7 +14,7 @@ export interface IMjmlHtmlAttributeProps { export function MjmlHtmlAttribute({ children, ...props -}: IMjmlHtmlAttributeProps): JSX.Element { +}: IMjmlHtmlAttributeProps): React.JSX.Element { return React.createElement( "mj-html-attribute", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlHtmlAttributes.tsx b/src/mjml/MjmlHtmlAttributes.tsx index 839c136..671bd37 100644 --- a/src/mjml/MjmlHtmlAttributes.tsx +++ b/src/mjml/MjmlHtmlAttributes.tsx @@ -16,7 +16,7 @@ export interface IMjmlHtmlAttributesProps { export function MjmlHtmlAttributes({ children, ...props -}: IMjmlHtmlAttributesProps): JSX.Element { +}: IMjmlHtmlAttributesProps): React.JSX.Element { return React.createElement( "mj-html-attributes", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlImage.tsx b/src/mjml/MjmlImage.tsx index 9390aa3..c929561 100644 --- a/src/mjml/MjmlImage.tsx +++ b/src/mjml/MjmlImage.tsx @@ -45,6 +45,6 @@ export interface IMjmlImageProps { mjmlClass?: string; } -export function MjmlImage(props: IMjmlImageProps): JSX.Element { +export function MjmlImage(props: IMjmlImageProps): React.JSX.Element { return React.createElement("mj-image", convertPropsToMjmlAttributes(props)); } diff --git a/src/mjml/MjmlInclude.tsx b/src/mjml/MjmlInclude.tsx index 1181be6..2d6e885 100644 --- a/src/mjml/MjmlInclude.tsx +++ b/src/mjml/MjmlInclude.tsx @@ -10,6 +10,6 @@ export interface IMjmlIncludeProps { path?: string; } -export function MjmlInclude(props: IMjmlIncludeProps): JSX.Element { +export function MjmlInclude(props: IMjmlIncludeProps): React.JSX.Element { return React.createElement("mj-include", convertPropsToMjmlAttributes(props)); } diff --git a/src/mjml/MjmlNavbar.tsx b/src/mjml/MjmlNavbar.tsx index 89be095..737081d 100644 --- a/src/mjml/MjmlNavbar.tsx +++ b/src/mjml/MjmlNavbar.tsx @@ -39,7 +39,7 @@ export interface IMjmlNavbarProps { export function MjmlNavbar({ children, ...props -}: IMjmlNavbarProps): JSX.Element { +}: IMjmlNavbarProps): React.JSX.Element { return React.createElement( "mj-navbar", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlNavbarLink.tsx b/src/mjml/MjmlNavbarLink.tsx index 54b6c45..f7757ad 100644 --- a/src/mjml/MjmlNavbarLink.tsx +++ b/src/mjml/MjmlNavbarLink.tsx @@ -38,7 +38,7 @@ export interface IMjmlNavbarLinkProps { export function MjmlNavbarLink({ children, ...props -}: IMjmlNavbarLinkProps): JSX.Element { +}: IMjmlNavbarLinkProps): React.JSX.Element { return React.createElement( "mj-navbar-link", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlPreview.tsx b/src/mjml/MjmlPreview.tsx index 7a6d131..3c1a397 100644 --- a/src/mjml/MjmlPreview.tsx +++ b/src/mjml/MjmlPreview.tsx @@ -17,7 +17,7 @@ export interface IMjmlPreviewProps { export function MjmlPreview({ children, ...props -}: IMjmlPreviewProps): JSX.Element { +}: IMjmlPreviewProps): React.JSX.Element { return React.createElement( "mj-preview", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlRaw.tsx b/src/mjml/MjmlRaw.tsx index 11fd190..d80e2c0 100644 --- a/src/mjml/MjmlRaw.tsx +++ b/src/mjml/MjmlRaw.tsx @@ -15,7 +15,10 @@ export interface IMjmlRawProps { dangerouslySetInnerHTML?: { __html: string }; } -export function MjmlRaw({ children, ...props }: IMjmlRawProps): JSX.Element { +export function MjmlRaw({ + children, + ...props +}: IMjmlRawProps): React.JSX.Element { return React.createElement( "mj-raw", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlSection.tsx b/src/mjml/MjmlSection.tsx index d280dfb..93574b4 100644 --- a/src/mjml/MjmlSection.tsx +++ b/src/mjml/MjmlSection.tsx @@ -40,7 +40,7 @@ export interface IMjmlSectionProps { export function MjmlSection({ children, ...props -}: IMjmlSectionProps): JSX.Element { +}: IMjmlSectionProps): React.JSX.Element { return React.createElement( "mj-section", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlSelector.tsx b/src/mjml/MjmlSelector.tsx index 8abdaf3..fc70ee9 100644 --- a/src/mjml/MjmlSelector.tsx +++ b/src/mjml/MjmlSelector.tsx @@ -14,7 +14,7 @@ export interface IMjmlSelectorProps { export function MjmlSelector({ children, ...props -}: IMjmlSelectorProps): JSX.Element { +}: IMjmlSelectorProps): React.JSX.Element { return React.createElement( "mj-selector", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlSocial.tsx b/src/mjml/MjmlSocial.tsx index 410dec8..d5fe158 100644 --- a/src/mjml/MjmlSocial.tsx +++ b/src/mjml/MjmlSocial.tsx @@ -43,7 +43,7 @@ export interface IMjmlSocialProps { export function MjmlSocial({ children, ...props -}: IMjmlSocialProps): JSX.Element { +}: IMjmlSocialProps): React.JSX.Element { return React.createElement( "mj-social", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlSocialElement.tsx b/src/mjml/MjmlSocialElement.tsx index 4d25e2e..f9e0efe 100644 --- a/src/mjml/MjmlSocialElement.tsx +++ b/src/mjml/MjmlSocialElement.tsx @@ -50,7 +50,7 @@ export interface IMjmlSocialElementProps { export function MjmlSocialElement({ children, ...props -}: IMjmlSocialElementProps): JSX.Element { +}: IMjmlSocialElementProps): React.JSX.Element { return React.createElement( "mj-social-element", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlSpacer.tsx b/src/mjml/MjmlSpacer.tsx index bc5b158..50dc465 100644 --- a/src/mjml/MjmlSpacer.tsx +++ b/src/mjml/MjmlSpacer.tsx @@ -25,6 +25,6 @@ export interface IMjmlSpacerProps { mjmlClass?: string; } -export function MjmlSpacer(props: IMjmlSpacerProps): JSX.Element { +export function MjmlSpacer(props: IMjmlSpacerProps): React.JSX.Element { return React.createElement("mj-spacer", convertPropsToMjmlAttributes(props)); } diff --git a/src/mjml/MjmlStyle.tsx b/src/mjml/MjmlStyle.tsx index ccadc0a..6c925dc 100644 --- a/src/mjml/MjmlStyle.tsx +++ b/src/mjml/MjmlStyle.tsx @@ -15,7 +15,7 @@ export interface IMjmlStyleProps { export function MjmlStyle({ children, ...props -}: IMjmlStyleProps): JSX.Element { +}: IMjmlStyleProps): React.JSX.Element { return React.createElement("mj-style", { ...convertPropsToMjmlAttributes(props), dangerouslySetInnerHTML: { diff --git a/src/mjml/MjmlTable.tsx b/src/mjml/MjmlTable.tsx index acf6e62..e6bff54 100644 --- a/src/mjml/MjmlTable.tsx +++ b/src/mjml/MjmlTable.tsx @@ -43,7 +43,7 @@ export interface IMjmlTableProps { export function MjmlTable({ children, ...props -}: IMjmlTableProps): JSX.Element { +}: IMjmlTableProps): React.JSX.Element { return React.createElement( "mj-table", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlText.tsx b/src/mjml/MjmlText.tsx index 55bca34..64490c8 100644 --- a/src/mjml/MjmlText.tsx +++ b/src/mjml/MjmlText.tsx @@ -36,7 +36,10 @@ export interface IMjmlTextProps { dangerouslySetInnerHTML?: { __html: string }; } -export function MjmlText({ children, ...props }: IMjmlTextProps): JSX.Element { +export function MjmlText({ + children, + ...props +}: IMjmlTextProps): React.JSX.Element { return React.createElement( "mj-text", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlTitle.tsx b/src/mjml/MjmlTitle.tsx index eb044c2..2e08421 100644 --- a/src/mjml/MjmlTitle.tsx +++ b/src/mjml/MjmlTitle.tsx @@ -17,7 +17,7 @@ export interface IMjmlTitleProps { export function MjmlTitle({ children, ...props -}: IMjmlTitleProps): JSX.Element { +}: IMjmlTitleProps): React.JSX.Element { return React.createElement( "mj-title", convertPropsToMjmlAttributes(props), diff --git a/src/mjml/MjmlWrapper.tsx b/src/mjml/MjmlWrapper.tsx index a21713f..86a76f4 100644 --- a/src/mjml/MjmlWrapper.tsx +++ b/src/mjml/MjmlWrapper.tsx @@ -40,7 +40,7 @@ export interface IMjmlWrapperProps { export function MjmlWrapper({ children, ...props -}: IMjmlWrapperProps): JSX.Element { +}: IMjmlWrapperProps): React.JSX.Element { return React.createElement( "mj-wrapper", convertPropsToMjmlAttributes(props),