react-datetime-picker icon indicating copy to clipboard operation
react-datetime-picker copied to clipboard

Invalid type when using arrow keys to pick values

Open jinmanm opened this issue 3 years ago • 7 comments

I get the following error when using the arrow keys to change dates. Failed prop type: Invalid prop `value` of type `number` supplied to `MinuteInput`, expected `string`.

My onChange function updates a state value which then renders out in the DateTimePicker.

export const DateTimePickerDialog = (props) => {

    const [datetime, setDatetime] = useState(props.datetime);

    return (
        <DateTimePicker
            maxDate={props.maxDatetime}
            minDate={props.minDatetime}
            value={datetime}
            onChange={setDatetime}
        />
    );
};

I cannot control what values get passed to the child components so is there something im missing?

jinmanm avatar Apr 06 '21 20:04 jinmanm

Same to me, as long as I use keyboard to type in the number, it shows me this warning

ZiangX avatar Apr 06 '21 20:04 ZiangX

Are you using any kind of library to wrap this datepicker? I am using react-hook-form

ZiangX avatar Apr 06 '21 20:04 ZiangX

the only library that would be wrapping it is redux im pretty sure; that is the actual component i copy and pasted

jinmanm avatar Apr 08 '21 13:04 jinmanm

Same to me, as long as I use keyboard to type in the number, it shows me this warning

For me it is no warning it is a full blown error that can cause crashes in an app

jinmanm avatar Apr 08 '21 13:04 jinmanm

the same issue

lemihthien avatar Apr 17 '21 03:04 lemihthien

went ahead and created a PR, hopefully this will resolve the warning

bilobom avatar Apr 27 '21 01:04 bilobom

I'm having the same issue...the app can't work !

There's no solution implemented ?

jespadas avatar Oct 04 '21 13:10 jespadas

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this issue will be closed in 14 days.

github-actions[bot] avatar Dec 12 '22 01:12 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Jan 02 '23 00:01 github-actions[bot]