Skip to content

Commit

Permalink
Merge pull request #4 from kadirahq/fix-key-warning
Browse files Browse the repository at this point in the history
Fix react-keys warning
  • Loading branch information
Muhammed Thanish authored Jun 15, 2016
2 parents 6fecc20 + 771acf0 commit 06bff4f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/components/PropTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var PropTable = function (_React$Component) {
(0, _values2.default)(props).map(function (row) {
return _react2.default.createElement(
'tr',
null,
{ key: row.property },
_react2.default.createElement(
'td',
null,
Expand Down
8 changes: 4 additions & 4 deletions dist/components/Story.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ var Story = function (_React$Component) {
_react2.default.createElement(
'pre',
null,
_react2.default.Children.map(this.props.children, function (root) {
return _react2.default.createElement(_Node2.default, { depth: 0, node: root });
_react2.default.Children.map(this.props.children, function (root, idx) {
return _react2.default.createElement(_Node2.default, { key: idx, depth: 0, node: root });
})
)
);
Expand All @@ -253,10 +253,10 @@ var Story = function (_React$Component) {
return null;
}

return this.props.propTables.map(function (comp) {
return this.props.propTables.map(function (comp, idx) {
return _react2.default.createElement(
'div',
null,
{ key: idx },
_react2.default.createElement(
'h3',
null,
Expand Down
2 changes: 1 addition & 1 deletion src/components/PropTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default class PropTable extends React.Component {
</thead>
<tbody>
{Object.values(props).map(row => (
<tr>
<tr key={row.property}>
<td>{row.property}</td>
<td>{row.propType}</td>
<td>{row.required}</td>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Story.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ export default class Story extends React.Component {
<div>
<h3>Example Source</h3>
<pre>
{React.Children.map(this.props.children, root => (
<Node depth={0} node={root}></Node>
{React.Children.map(this.props.children, (root, idx) => (
<Node key={idx} depth={0} node={root}></Node>
))}
</pre>
</div>
Expand All @@ -168,8 +168,8 @@ export default class Story extends React.Component {
return null;
}

return this.props.propTables.map(comp => (
<div>
return this.props.propTables.map((comp, idx) => (
<div key={idx}>
<h3>{comp.displayName || comp.name} PropTypes</h3>
<PropTable comp={comp} />
</div>
Expand Down

0 comments on commit 06bff4f

Please sign in to comment.