Add a 'throwIfNamespace' option for JSX transform (#6563)
* Added tests for ifThrowNamespace flag * JSX transformator could work with XMLNamespaces (ifThrowNamespace flag) * Use template literal instead * Attempt to reword the message * Added docs * Reworded docs * Reworded docs * Fixed missing space in error message
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"throws": "Namespace tags are not supported. ReactJSX is not XML."
|
||||
"throws": "Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can turn on the 'throwIfNamespace' flag to bypass this warning."
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<f:image />;
|
||||
@@ -0,0 +1 @@
|
||||
h("f:image", null);
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"transform-react-jsx",
|
||||
{
|
||||
"pragma": "h",
|
||||
"throwIfNamespace": false
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<f:image />;
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"plugins": [
|
||||
[
|
||||
"transform-react-jsx",
|
||||
{
|
||||
"pragma": "h",
|
||||
"throwIfNamespace": true
|
||||
}
|
||||
]
|
||||
],
|
||||
"throws": "Namespace tags are not supported by default. React's JSX doesn't support namespace tags. You can turn on the 'throwIfNamespace' flag to bypass this warning."
|
||||
}
|
||||
Reference in New Issue
Block a user