Reactjs 将道具映射到react工具箱输入的状态
React工具箱似乎要求我使用状态作为其输入值。如何将我的redux道具映射到状态,以便与Reactjs 将道具映射到react工具箱输入的状态,reactjs,redux,react-toolbox,Reactjs,Redux,React Toolbox,React工具箱似乎要求我使用状态作为其输入值。如何将我的redux道具映射到状态,以便与react toolbox一起使用 <Input type='text' label='Name' name='name' value={this.state.name} onChange={this.handleChange.bind(this, 'name')} /> 我想如果我在redux状态改变时在构造函数中设置它,它不会更新我的状态吗 您需
react toolbox
一起使用
<Input type='text'
label='Name'
name='name'
value={this.state.name}
onChange={this.handleChange.bind(this, 'name')} />
我想如果我在redux状态改变时在构造函数中设置它,它不会更新我的状态吗
Redux文档:
如果我遗漏了什么,请告诉我
const mapStateToProps = state => ({
inputBoxValue: state.myReduer.inputBoxValue,
});
export default connect(mapStateToProps)(myComponent);
<Input type='text'
label='Name'
name='name'
value={this.props.name}
onChange={this.handleChange.bind(this, 'name')} />