如何从引导模式中获得价值?我正在使用reacstrap
https://github.com/reactstrap
这是我调用模态的页面
import { ButtonGroup, Button, Input, Row, Col } from 'reactstrap';
import RegisterLookup from '../lookup/RegisterLookup';
<RegisterLookup
isOpen={this.state.register}
toggle={this.toggleRegister}
className={''}
/>
这是我的模态组件:
register() {
console.log("da")
}
render() {
return (
<div>
<Modal isOpen={this.props.isOpen} toggle={this.props.toggle} className={this.props.className} size="lg">
<ModalHeader toggle={this.props.toggle}>Register</ModalHeader>
<ModalBody>
<div className="row mb-2">
<div className="col-sm-12">
<Row>
<Col md="6" xs="12">
<FormGroup row>
<Label sm="4">Enter your name <span className="text-danger">*</span></Label>
<Col>
<Input />
</Col>
</FormGroup>
</Col>
</Row>
</div>
</div>
</ModalBody>
<ModalFooter>
<Button className="pull-right" type="button" color="primary" onClick={() => { this.register(); }}>
<span className="hidden-xs-down">Register </span>
</Button>
</ModalFooter>
</Modal>
</div>
);
}
}
RegisterLookup.defaultProps = {
isOpen: PropTypes.bool,
toggle: PropTypes.func,
className: PropTypes.string,
};
RegisterLookup.propTypes = {
isOpen: PropTypes.bool,
toggle: PropTypes.func,
className: PropTypes.string,
};
但是如何将我在模态中输入的值获取到调用模态的页面?提前致谢。