Skip to content
Discussion options

You must be logged in to vote

Answering my question: for the time, looking at the code, I saw that if the minutes and hours properties of the element change, the internal states for those are also updated. So I created states to track the values I want to use in the modal for both minutes and hours, and I simply set them before opening the modal:

  const [timePickerHours, setTimePickerHours] = useState<number>();
  const [timePickerMinutes, setTimePickerMinutes] = useState<number>();

  const selectTime = (hours, minutes) => {
    setTimePickerHours(Number(hours));
    setTimePickerMinutes(Number(minutes));
    setTimePickerVisible(true);
  };

  return (
      <TimePickerModal
        hours={timePickerHours}
        m…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gboudreau
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant