Last active
February 23, 2018 10:17
-
-
Save abinavseelan/f654b5f14ff8ffd55725c93ee94c60dd to your computer and use it in GitHub Desktop.
Component for a dropdown interaction (2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
class Card extends Component { | |
constructor() { | |
super(); | |
this.state = { | |
showMenu: false, | |
} | |
} | |
render() { | |
return ( | |
<div> | |
<button> | |
Show menu | |
</button> | |
{ | |
this.state.showMenu | |
? ( | |
<div className="menu"> | |
<button> Menu item 1 </button> | |
<button> Menu item 2 </button> | |
<button> Menu item 3 </button> | |
</div> | |
) | |
: ( | |
null | |
) | |
} | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment