mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Tweak attribute whitelist table (#10559)
* Move null and undefined to the end * Highlight attributes with changes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user