Javascript 选择列表在react中未突出显示正确值的问题

Javascript 选择列表在react中未突出显示正确值的问题,javascript,reactjs,select,Javascript,Reactjs,Select,我有以下课程: class SelectCategory extends Component { constructor(props){ super(props); this.state = {value: props.book.category}; this.handleChange = this.handleChange.bind(this); } handleChange = (event) => {

我有以下课程:

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 to Read</option>
                <option value="read">Read</option>
                <option value="none">None</option>
            </select>)
    }
}
class SelectCategory扩展组件{
建造师(道具){
超级(道具);
this.state={value:props.book.category};
this.handleChange=this.handleChange.bind(this);
}
handleChange=(事件)=>{
console.log('set state handle change',event.target.value)
this.props.onChange(this.props.book、event.target.value)
}
render(){
返回(
搬到。。。
正在阅读
想读书吗
阅读
没有一个
)
}
}
我遇到的问题是,当我选择不同的值时,状态会发生变化,但所选项目保持不变

我的问题是,如果状态被设置为我想要的状态,为什么它没有反映在实际的select元素中


谢谢你的帮助

我可以看一下主元件代码吗?顺便说一句,如果您已经用
handleChange=(事件)=>{}
声明函数,则不需要
this.handleChange=this.handleChange.bind(this)
,非常感谢!就是那个问题!我删除了线,它的工作!我可以问一下为什么它会是不正确的,因为每当状态发生变化,并且父对象将再次呈现它时,它将被设置为新的状态,而不是保持状态吗?也可以按照以下方式设置状态:
constructor(props){super(props);this.setState({value:props.book.category});}