From f842f74d2d3723c75e6591931607b4d7141bf0db Mon Sep 17 00:00:00 2001 From: "${Mr.DJA}" <42304709+iMrDJAi@users.noreply.github.com> Date: Fri, 30 Sep 2022 20:54:51 +0100 Subject: [PATCH] feat: add `throwIfNamespace` option for custom JSX runtime (#9571) --- packages/plugin-react/src/index.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index 5a82b0a2a6cd0e..3617605afc686d 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -40,6 +40,11 @@ export interface Options { * @default true */ jsxPure?: boolean + /** + * Toggles whether or not to throw an error if an XML namespaced tag name is used. + * @default true + */ + jsxThrowIfNamespace?: boolean /** * Babel configuration applied in both dev and prod. */ @@ -248,7 +253,8 @@ export default function viteReact(opts: Options = {}): PluginOption[] { { runtime: 'automatic', importSource: opts.jsxImportSource, - pure: opts.jsxPure !== false + pure: opts.jsxPure !== false, + throwIfNamespace: opts.jsxThrowIfNamespace } ])