Skip to content

Commit 76b57e9

Browse files
Danil Zhelnovglasserc
authored andcommitted
Fix customObject sample (rjsf-team#716)
The sample for customObject.js had few defects. React 15.6.1 throws an no-keys-defined warning as well as 'child-can-not-be-objects' exception. The code has been changed to fix these issues. * Fixed customObject sample to fix "Objects are not valid as a React child" error for react 15.6.1 and to avoid "https://fb.me/react-warning-keys" warning * Run prettier
1 parent 6322579 commit 76b57e9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

playground/samples/customObject.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ function ObjectFieldTemplate({ TitleField, properties, title, description }) {
66
<TitleField title={title} />
77
<div className="row">
88
{properties.map(prop => (
9-
<div className="col-lg-2 col-md-4 col-sm-6 col-xs-12">{prop}</div>
9+
<div
10+
className="col-lg-2 col-md-4 col-sm-6 col-xs-12"
11+
key={prop.content.key}>
12+
{prop.content}
13+
</div>
1014
))}
1115
</div>
1216
{description}

0 commit comments

Comments
 (0)