Tweak attribute whitelist table (#10559)

* Move null and undefined to the end

* Highlight attributes with changes
This commit is contained in:
Dan Abramov
2017-08-28 15:13:35 -06:00
committed by GitHub
parent 575cfadf3e
commit ebb5a33ec2

View File

@@ -21,14 +21,6 @@ const types = [
testValue: 'a string',
testDisplayValue: "'a string'",
},
{
name: 'null',
testValue: null,
},
{
name: 'undefined',
testValue: undefined,
},
{
name: 'empty string',
testValue: '',
@@ -115,6 +107,14 @@ const types = [
name: 'function',
testValue: function f() {},
},
{
name: 'null',
testValue: null,
},
{
name: 'undefined',
testValue: undefined,
},
];
function getProperty(propertyName) {
@@ -2841,7 +2841,14 @@ function CellContent(props) {
if (rowIndex === 0) {
return null;
}
return <RowHeader>{attribute.name}</RowHeader>;
const hasSameBehaviorForAll = types.every(
type => table.get(attribute).get(type.name).hasSameBehavior
);
return (
<RowHeader>
{hasSameBehaviorForAll ? attribute.name : <b>{attribute.name}</b>}
</RowHeader>
);
}
if (rowIndex === 0) {