Skip to content

Commit 8790c96

Browse files
committed
fix: react key error and dark popover
1 parent f01de44 commit 8790c96

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/components/SchemaRow.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,20 @@ export const SchemaRow: React.FunctionComponent<ISchemaRow> = ({ node, treeStore
119119
let elem = null;
120120
if (Array.isArray(validation)) {
121121
elem = validation.map((v, i) => (
122-
<div className="mt-1 mr-1 flex items-center">
123-
<div className="px-1 bg-gray-2 font-bold text-sm rounded" key={i}>
124-
{v}
125-
</div>
122+
<div key={i} className="mt-1 mr-1 flex items-center">
123+
<div className="px-1 bg-gray-2 dark:bg-gray-8 font-bold text-sm rounded">{v}</div>
126124
{i < validation.length - 1 ? <div>,</div> : null}
127125
</div>
128126
));
129127
} else if (typeof validation === 'object') {
130128
elem = (
131-
<div className="m-1 px-1 bg-gray-2 font-bold text-sm rounded" key={index}>
129+
<div className="m-1 px-1 bg-gray-2 dark:bg-gray-8 font-bold text-sm rounded" key={index}>
132130
{'{...}'}
133131
</div>
134132
);
135133
} else {
136134
elem = (
137-
<div className="m-1 px-1 bg-gray-2 font-bold text-sm rounded" key={index}>
135+
<div className="m-1 px-1 bg-gray-2 dark:bg-gray-8 font-bold text-sm rounded" key={index}>
138136
{JSON.stringify(validation)}
139137
</div>
140138
);

0 commit comments

Comments
 (0)