Skip to content

Commit b7dfa96

Browse files
emilpalssondanez
authored andcommitted
Fix two warnings in the examples (#306)
* Use onChange instead of onClick for checkbox in examples * Add missing key props in two lists in examples
1 parent a0421bb commit b7dfa96

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/src/components/ExampleItem.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class ExampleItem extends Component {
1717
});
1818
}
1919

20-
handleEditSourceClick = () => {
20+
handleEditSourceChange = () => {
2121
this.setState({
2222
editorOpen: !this.state.editorOpen,
2323
});
@@ -46,7 +46,7 @@ export default class ExampleItem extends Component {
4646
id={formId}
4747
name={formId}
4848
checked={editorOpen}
49-
onClick={this.handleEditSourceClick}
49+
onChange={this.handleEditSourceChange}
5050
/>
5151
View source
5252
</label>

examples/src/components/examples/Avengers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ const code = `class Component extends React.Component {
7070
const { img, color: backgroundColor, text: color, desc } = this.characters[name];
7171
7272
tabs.push(
73-
<Tab style={{ backgroundColor }} className="avengers-tab">
73+
<Tab style={{ backgroundColor }} className="avengers-tab" key={name}>
7474
<img src={img} alt={name} height="32" width="32" />
7575
</Tab>
7676
);
7777
7878
tabPanels.push(
79-
<TabPanel style={{ backgroundColor, color }} className="avengers-tab-panel">
79+
<TabPanel style={{ backgroundColor, color }} className="avengers-tab-panel" key={name}>
8080
{desc}
8181
</TabPanel>
8282
);

0 commit comments

Comments
 (0)