feat: add throwIfNamespace option for custom JSX runtime#9571
feat: add throwIfNamespace option for custom JSX runtime#9571aleclarson merged 3 commits intovitejs:mainfrom
throwIfNamespace option for custom JSX runtime#9571Conversation
throwIfNamespace option for custom JSX runtimesthrowIfNamespace option for custom JSX runtimes
patak-cat
left a comment
There was a problem hiding this comment.
I think we could merge this option. For a future version, we may want to directly let the use pass a jsxOptions object. For the moment, this looks better as there aren't many other options to configure and we may want to migrate to something different than babel later on. https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#options
|
@patak-dev When will you merge this? |
|
@aleclarson @frandiox could you check if this looks good to you so we can merge it? |
|
@patak-dev LGTM, we haven't had any issue with prefixes in JSX so far but I guess it's good to have an option to disable it👍 |
|
@patak-dev Go ahead :) |
|
@patak-dev Can you merge it now? |
throwIfNamespace option for custom JSX runtimesthrowIfNamespace option for custom JSX runtime
|
@aleclarson Thank you! Is there any ETA on when this change will get released on NPM? |
|
@iMrDJAi it is going to be released in tandem with Vite 3.2. We should get a beta for plugin-react out next week |
Description
This change allows passing
throwIfNamespacetobabel-plugin-transform-react-jsxthrough@vitejs/plugin-reactoptions.Fixes #6554.
Additional context
This option is enabled by default, causing the following error when using xml namespace prefixes:
Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can set throwIfNamespace: false to bypass this warning.Currently there is no way to set
throwIfNamespacetofalsewithout that change.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).