-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add throwIfNamespace
option for custom JSX runtime
#9571
Conversation
throwIfNamespace
option for custom JSX runtimesthrowIfNamespace
option for custom JSX runtimes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
throwIfNamespace
tobabel-plugin-transform-react-jsx
through@vitejs/plugin-react
options.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
throwIfNamespace
tofalse
without that change.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).