Skip to content

Commit

Permalink
Merge pull request #2246 from yuri-sakharov/fix/readme-1
Browse files Browse the repository at this point in the history
Fixed readme example. Issue #2235
  • Loading branch information
JedWatson authored Jan 4, 2018
2 parents d2a3afd + 3a4fe26 commit bb69f47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ class App extends React.Component {
console.log(`Selected: ${selectedOption.label}`);
}
render() {
const { selectedOption } = this.state;
const value = selectedOption && selectedOption.value;

return (
<Select
name="form-field-name"
value={this.state.selectedOption.value}
value={value}
onChange={this.handleChange}
options={[
{ value: 'one', label: 'One' },
Expand Down

0 comments on commit bb69f47

Please sign in to comment.