Topic: MDBTimePicker in map

marrielle.aboujaoude free asked 3 years ago

Expected behavior updated "MDBTimePicker" once my state is updated

Actual behavior I'm trying to update my time picker once i call an onclick function from outside of MDBTimePicker

Resources (screenshots, code snippets etc.)

Jakub Chmura staff answered 3 years ago

Hi @marrielle.aboujaoude,

As I thought, it's not possible to control this component from outside when it's already rendered. hours and minutes props give you the possibility to pick hours and minutes before initialization. After initialization, we have no influence on the state of the component.

We try to fix this as soon as possible.

Best regards,


marrielle.aboujaoude free commented 3 years ago

Thank you because it's a huge bug on my portal and if i want to change it i will need to change all the timepicker

Jakub Chmura staff commented 3 years ago


We work on the solution right now, if everything goes fine we publish fix in the next release.

Best regards,


Jakub Chmura staff answered 3 years ago

Hi @marrielle.aboujaoude,

Can you send me a sample of your code?

I'll try to do something with this, but it seems to me that's not possible in this component. I'll try to check what's wrong but I'm not able to reproduce this situation without your example.

Best regards,


marrielle.aboujaoude free commented 3 years ago

Kindly check the following sample

import React from "react"; import { MDBRow, MDBCol, MDBIcon, MDBTimePicker } from "mdbreact";

class dummySample extends React.Component { constructor() { super(); this.state = { hour: "1", } this.getPickerValueTo = this.getPickerValueTo.bind(this) }

getPickerValueTo = (value) => {
    this.setState({ hour: value });

RemoveRow() {
    this.setState({ hour: "12" });

render() {

    return (
                <MDBCol md="1">
                <MDBCol md="1">
                        label="To time"
                        getValue={value => this.getPickerValueTo(value)}
                <MDBCol md="1">
                    <div onClick={() => this.RemoveRow()}><MDBIcon icon="edit" /></div>


        </React.Fragment >


export default dummySample

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 4.21.1
  • Device: laptop
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: No