Skip to content

Commit

Permalink
Merge pull request #2650 from spankie/patch-1
Browse files Browse the repository at this point in the history
Update README.md
  • Loading branch information
JedWatson committed May 29, 2018
2 parents 02ad75e + fddbc5c commit 649d1f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Expand Up @@ -82,7 +82,10 @@ class App extends React.Component {
}
handleChange = (selectedOption) => {
this.setState({ selectedOption });
console.log(`Selected: ${selectedOption.label}`);
// selectedOption can be null when the `x` (close) button is clicked
if (selectedOption) {
console.log(`Selected: ${selectedOption.label}`);
}
}
render() {
const { selectedOption } = this.state;
Expand Down

0 comments on commit 649d1f4

Please sign in to comment.