Skip to content

Commit f842f74

Browse files
authored
feat: add throwIfNamespace option for custom JSX runtime (#9571)
1 parent 2266d83 commit f842f74

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/plugin-react/src/index.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ export interface Options {
4040
* @default true
4141
*/
4242
jsxPure?: boolean
43+
/**
44+
* Toggles whether or not to throw an error if an XML namespaced tag name is used.
45+
* @default true
46+
*/
47+
jsxThrowIfNamespace?: boolean
4348
/**
4449
* Babel configuration applied in both dev and prod.
4550
*/
@@ -248,7 +253,8 @@ export default function viteReact(opts: Options = {}): PluginOption[] {
248253
{
249254
runtime: 'automatic',
250255
importSource: opts.jsxImportSource,
251-
pure: opts.jsxPure !== false
256+
pure: opts.jsxPure !== false,
257+
throwIfNamespace: opts.jsxThrowIfNamespace
252258
}
253259
])
254260

0 commit comments

Comments
 (0)