Topic: InputRange - unclear warnings when used
Satanko
pro
asked 7 years ago
<InputRange min={0} max={100} value={this.sliderValue}
getValue={this.onChangeSlider}/>
modules.js?hash=ff734b4192910c020630489b4c0624764a04b77f:21211 Warning: Failed prop type: Invalid prop `value` of type `number` supplied to `t`, expected `string`.
When passing a string:
<InputRange min={0} max={100} value={this.sliderValue+''}
getValue={this.onChangeSlider}/>
Warning: Failed prop type: Invalid prop `value` of type `string` supplied to `t`, expected `number`.
I suppose it is correct to use numbers. But the warning is distracting.
Jakub Mandra
staff
answered 7 years ago
Jakub Mandra
staff
answered 7 years ago
Satanko
pro
answered 7 years ago
<Modal size="lg" isOpen={this.modalShow} fade={false} toggle={this.toggleModal}
className={this.props.className}>
<ModalHeader toggle={this.toggle}>Add amount</ModalHeader>
<ModalBody>
<Container fluid className="text-black">
<Row>
<Col md="2" className="">Amount: </Col>
<Col md="10" className="mr-auto">{this.selectedRow.totalAmount}</Col>
</Row>
<Row>
<Col md="6" className="ml-auto">
<Input label="New Amount"
value={this.sliderValue}/>
</Col>
<Col md="6" className="ml-auto">
<InputRange min={0} max={100}
value={this.sliderValue+''}
getValue={this.onChangeSlider}/>
</Col>
</Row>
</Container>
</ModalBody>
<ModalFooter>
<Button color="primary" onClick={this.addAmount}>Aufbuchen</Button>{' '}
<Button color="danger" onClick={this.toggleModal}>Abbrechen</Button>
</ModalFooter>
</Modal>
I can't see any problem. Maybe do you?
Kind regards,
Josef
Jakub Mandra
staff
answered 7 years ago
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Pro
- Premium support: No
- Technology: MDB React
- MDB Version: 4.7.0
- Device: Laptop
- Browser: Chrome
- OS: OSX
- Provided sample code: No
- Provided link: No
Satanko pro commented 7 years ago
Besides that, it would be great to have the option 'step' as it is available in a regular input object. E.g. I'd like to set only numbers like 10, 20, 30, 40, 50....patatagrammar pro commented 7 years ago
I am having the same issue with the latest version, 4.7.1Jakub Mandra staff commented 7 years ago
Are error logs the same?