Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ function doSetAttribute(el, props, propName) {
} else if (props[propName] && props[propName].constructor === Function) {
return;
} else {
el.setAttribute(propName, props[propName]);
var val = props[propName];
if (val === undefined || val === null) {
val = "";
}
el.setAttribute(propName, val);
}
}

Expand Down Expand Up @@ -75,7 +79,7 @@ function updateAttributes(el, prevProps, props) {
if (!filterNonEntityPropNames(propName)) {
continue;
}
if (props[propName] === undefined) {
if (Object.keys(props).indexOf(propName) === -1) {
el.removeAttribute(propName);
}
}
Expand Down Expand Up @@ -182,7 +186,7 @@ var Entity = exports.Entity = function (_React$Component) {
// Let through props that are OK to render initially.
var reactProps = {};
for (propName in props) {
if (['className', 'id', 'mixin'].indexOf(propName) !== -1 || propName.indexOf('data-') === 0) {
if (['className', 'id', 'mixin', 'loading-screen'].indexOf(propName) !== -1 || propName.indexOf('data-') === 0) {
reactProps[propName] = props[propName];
}
}
Expand Down
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aframe-react",
"version": "4.4.0",
"version": "4.5.0",
"description": "Build virtual reality experiences with A-Frame and React.",
"main": "dist/index.js",
"scripts": {
Expand All @@ -17,35 +17,35 @@
]
},
"devDependencies": {
"aframe": "^0.5.0",
"babel": "^6.3.13",
"babel-cli": "^6.3.15",
"babel-jest": "^16.0.0",
"babel-loader": "^6.4.1",
"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.3.13",
"babel-preset-stage-0": "^6.3.13",
"babel-register": "^6.16.3",
"chai": "^3.5.0",
"chai-shallow-deep-equal": "^1.4.6",
"jest": "^16.0.1",
"karma": "^0.13.15",
"aframe": "0.5.0",
"babel": "6.3.13",
"babel-cli": "6.3.15",
"babel-jest": "16.0.0",
"babel-loader": "6.4.1",
"babel-preset-es2015": "6.3.13",
"babel-preset-react": "6.3.13",
"babel-preset-stage-0": "6.3.13",
"babel-register": "6.16.3",
"chai": "3.5.0",
"chai-shallow-deep-equal": "1.4.6",
"jest": "16.0.1",
"karma": "0.13.15",
"karma-chai-shallow-deep-equal": "0.0.4",
"karma-chrome-launcher": "2.0.0",
"karma-firefox-launcher": "^0.1.7",
"karma-mocha": "^0.2.1",
"karma-mocha-reporter": "^1.1.3",
"karma-firefox-launcher": "0.1.7",
"karma-mocha": "0.2.1",
"karma-mocha-reporter": "1.1.3",
"karma-sinon-chai": "1.1.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.3",
"mocha": "^3.1.2",
"mozilla-download": "^1.1.1",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-test-renderer": "^15.5.4",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "2.0.3",
"mocha": "3.1.2",
"mozilla-download": "1.1.1",
"react": "15.5.4",
"react-dom": "15.5.4",
"react-test-renderer": "15.5.4",
"sinon": "1.17.5",
"sinon-chai": "2.8.0",
"webpack": "^2.3.2"
"webpack": "2.3.2"
},
"repository": {
"type": "git",
Expand Down
10 changes: 7 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ function doSetAttribute (el, props, propName) {
} else if (props[propName] && props[propName].constructor === Function) {
return;
} else {
el.setAttribute(propName, props[propName]);
let val = props[propName];
if(val === undefined || val === null){
val = "";
}
el.setAttribute(propName, val);
}
}

Expand All @@ -45,7 +49,7 @@ function updateAttributes (el, prevProps, props) {
if (prevProps) {
for (propName in prevProps) {
if (!filterNonEntityPropNames(propName)) { continue; }
if (props[propName] === undefined) { el.removeAttribute(propName); }
if (Object.keys(props).indexOf(propName) === -1) { el.removeAttribute(propName); }
}
}
}
Expand Down Expand Up @@ -122,7 +126,7 @@ export class Entity extends React.Component {
// Let through props that are OK to render initially.
let reactProps = {};
for (propName in props) {
if (['className', 'id', 'mixin'].indexOf(propName) !== -1 ||
if (['className', 'id', 'mixin', 'loading-screen'].indexOf(propName) !== -1 ||
propName.indexOf('data-') === 0) {
reactProps[propName] = props[propName];
}
Expand Down
Loading