You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,28 @@ var ast = acorn.parse(code, {
37
37
});
38
38
```
39
39
40
+
Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in `<namespace:Object.Property />`, so it was deprecated in `[email protected]`. If you still want to opt-in to support of such constructions, you can pass the following option:
41
+
42
+
```javascript
43
+
var ast =acorn.parse(code, {
44
+
plugins: {
45
+
jsx: { allowNamespacedObjects:true }
46
+
}
47
+
});
48
+
```
49
+
50
+
Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely:
51
+
52
+
```javascript
53
+
var ast =acorn.parse(code, {
54
+
plugins: {
55
+
jsx: { allowNamespaces:false }
56
+
}
57
+
});
58
+
```
59
+
60
+
Note that by default `allowNamespaces` is enabled for spec compliancy.
61
+
40
62
## License
41
63
42
64
This plugin is issued under the [MIT license](./LICENSE).
0 commit comments