Skip to content

Commit

Permalink
[docs] Show an example with the data- pattern (mui#7924)
Browse files Browse the repository at this point in the history
* fixes mui#7923

* Update FlatButtons.js

* Update FlatButtons.js

* Update FlatButtons.js
  • Loading branch information
Sigfried authored and oliviertassinari committed Aug 26, 2017
1 parent 2b45f00 commit 9add0de
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/src/pages/demos/buttons/FlatButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const styles = theme => ({
},
});

function doSomething(event) {
// eslint-disable-next-line no-console
console.log(event.currentTarget.getAttribute('data-something'));
}

function FlatButtons(props) {
const classes = props.classes;
return (
Expand All @@ -38,6 +43,9 @@ function FlatButtons(props) {
<Button dense className={classes.button}>
Dense
</Button>
<Button className={classes.button} onClick={doSomething} data-something="here I am">
Does something
</Button>
</div>
);
}
Expand Down

0 comments on commit 9add0de

Please sign in to comment.