mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Don't break if no attribute value
Fixes the transformation of things like `<button disabled>`.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jsx_whitespace_transformer",
|
||||
"description": "A utility to update your JSX to behave identically in React 0.8 and React 0.9.",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"main": "run.js",
|
||||
"dependencies": {
|
||||
"esprima-fb": "~2001.1001.0-dev-harmony-fb",
|
||||
|
||||
+3
-1
@@ -20,7 +20,9 @@ var utils = require('jstransform/src/utils');
|
||||
|
||||
function visitReactTag(traverse, object, path, state) {
|
||||
object.attributes.forEach(function(attr, index) {
|
||||
traverse(attr.value, path, state);
|
||||
if (attr.value) {
|
||||
traverse(attr.value, path, state);
|
||||
}
|
||||
});
|
||||
|
||||
object.children.forEach(function(child, index) {
|
||||
|
||||
Reference in New Issue
Block a user