Skip to content

Commit 2280b54

Browse files
author
Ben Taylor
committed
Fixing changes to generic component
1 parent 231773c commit 2280b54

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ For example, If Review preset didn't exist, you could write:
113113

114114
```html
115115
<JSONLD>
116-
<Generic id="review" jsonldtype="Review" schema={{name: "It is awesome", reviewBody: "This is great!"}}>
117-
<Generic id="itemReviewed" jsonldtype="Product" schema={{"@id":"product-x"}} />
118-
<Generic id="author" jsonldtype="Person" schema={{name: "Cool Carl"}}/>
119-
<Generic id="locationCreated" jsonldtype="AdministrativeArea" schema={{name: "Chicago, IL"}}/>
116+
<Generic type="review" jsonldtype="Review" schema={{name: "It is awesome", reviewBody: "This is great!"}}>
117+
<Generic type="itemReviewed" jsonldtype="Product" schema={{"@id":"product-x"}} />
118+
<Generic type="author" jsonldtype="Person" schema={{name: "Cool Carl"}}/>
119+
<Generic type="locationCreated" jsonldtype="AdministrativeArea" schema={{name: "Chicago, IL"}}/>
120120
</Generic>
121121
</JSONLD>
122122
```

src/core/schemas/Generic.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ class ChildNode extends JSONLDAbstractNode {
77
const details = {
88
'@type': this.props.jsonldtype
99
}
10-
return isFirstChildNode
11-
? Object.assign({...details, ...schema}, ...parseChildren)
12-
: Object.assign({[this.props.id]: { ...details, ...schema, ...parseChildren}});
10+
11+
return Object.assign({...details, ...schema}, ...parseChildren);
1312
}
1413
}
1514

src/example/containers/Example.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ class Example extends PureComponent {
5757
</Graph>
5858
</JSONLD>
5959
<JSONLD>
60-
<Generic id="review" jsonldtype="Review" schema={{name: "It is awesome", reviewBody: "This is great!"}}>
61-
<Generic id="itemReviewed" jsonldtype="Product" schema={{"@id":"product-x"}} />
62-
<Generic id="author" jsonldtype="Person" schema={{name: "Cool Carl"}}/>
63-
<Generic id="locationCreated" jsonldtype="AdministrativeArea" schema={{name: "Chicago, IL"}}/>
60+
<Generic type="review" jsonldtype="Review" schema={{name: "It is awesome", reviewBody: "This is great!"}}>
61+
<Generic type="itemReviewed" jsonldtype="Product" schema={{"@id":"product-x"}} />
62+
<Generic type="author" jsonldtype="Person" schema={{name: "Cool Carl"}}/>
63+
<Generic type="locationCreated" jsonldtype="AdministrativeArea" schema={{name: "Chicago, IL"}}/>
6464
</Generic>
6565
</JSONLD>
6666
</section>

0 commit comments

Comments
 (0)