Created
September 15, 2018 04:39
-
-
Save leslie-alldridge/75b55aa6dad020797871559c7d0380ba to your computer and use it in GitHub Desktop.
toggle field react
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
addInventory (viewListID) { | |
console.log('hit'); | |
this.setState(prevState => ({ | |
viewListID: prevState.viewListID == viewListID ? null : viewListID | |
})); | |
} | |
{this.state.viewListID == bag.id && <BagList key={bag.id} id = {bag.id} description={bag.description} destination={bag.destination}/>} | |
this.state = { | |
bags: this.props.bags || [], | |
viewList: false, | |
viewListID: null | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment