fix: false values are removed from style string. closes #1692 (#1693)

This commit is contained in:
Michael Rawlings 2021-05-14 11:53:54 -07:00 committed by GitHub
parent 5de61573bb
commit ac140d4628
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -23,7 +23,7 @@ module.exports = function styleHelper(style) {
} else if (type === "object") {
for (var name in style) {
var value = style[name];
if (value != null) {
if (value != null && value !== false) {
if (typeof value === "number" && value) {
value += "px";
}

View File

@ -1 +1 @@
div style={color: 'red', fontWeight: 'bold', 'background-color':'blue'}
div style={color: 'red', margin: false, fontWeight: 'bold', 'background-color':'blue'}