javascript - issue with select list not highlighting correct value in react -


i have following class:

class selectcategory extends component {      constructor(props){         super(props);          this.state = {value: props.book.category};         this.handlechange = this.handlechange.bind(this);     }      handlechange = (event) => {         console.log('set state handle change', event.target.value)         this.props.onchange(this.props.book, event.target.value)     }      render() {         return (             <select value={this.state.value} onchange={this.handlechange} >                 <option value="none" disabled>move to...</option>                 <option value="currentlyreading">currently reading</option>                 <option value="wanttoread">want read</option>                 <option value="read">read</option>                 <option value="none">none</option>             </select>)     } } 

the issue have state changes when select different value, selected item remains same.

the console log

improper value being set

my question if state being set 1 want, why isnt being reflected in actual select element?

thanks help!


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -