react-multi-date-picker icon indicating copy to clipboard operation
react-multi-date-picker copied to clipboard

Warnings while using custom component

Open aaintiasheva opened this issue 1 year ago • 8 comments

Hi! I have a problem with a custom component. I need to add some styles and icon to input, so I added render props

  <Controller
          control={control}
          name="publicationDate"
          render={({field}) => <DatePicker
            range
            containerStyle={{width: '100%'}}
            value={field.value}
            calendarPosition="bottom"
            onChange={(date) => {
              date && setValue('publicationDate', (date as DateObject[]).map(date => new Date(date.toString()).toISOString()))
            }}
            render={
              <TextField
                {...field}
                label="Version publication date"
                InputProps={{endAdornment: <CalendarIcon/>}}/>
            }
          />}
        />

and it leads to two problems:

  1. Warning: React does not recognize the openCalendar prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase opencalendar instead. If you accidentally passed it from a parent component, remove it from the DOM element.

  2. Warning: React does not recognize the handleValueChange prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase handlevaluechange instead. If you accidentally passed it from a parent component, remove it from the DOM element.

@shahabyazdi, can you help me please?

aaintiasheva avatar Jun 08 '23 09:06 aaintiasheva

I also have the same issue :/

pedram6195 avatar Jun 10 '23 06:06 pedram6195

Please upgrade to v4.1.1, this will fix the problem. Thank you.

shahabyazdi avatar Jun 13 '23 13:06 shahabyazdi

Hi! Still reproduced(( image image

aaintiasheva avatar Jun 14 '23 08:06 aaintiasheva

I see Just get these two props from your custom input and don't pass them to your component. (like this example)

I have to deprecate them but can't do it so fast. may be in the next major version.

shahabyazdi avatar Jun 14 '23 12:06 shahabyazdi

@shahabyazdi - This appears to occur for render={ <InputIcon /> } as well. That component is not stripping out the handleValueChange and throws this error for me in v4.2.0

danieliser avatar Nov 02 '23 05:11 danieliser

Also seeing similar warnings for the DatePanel plugin for minDate and maxDate props.

danieliser avatar Nov 02 '23 08:11 danieliser

I have the same issue, I'm on version 4.4.1, and the issue happens when using render={ <Icon /> }

Shaker-Hamdi avatar Feb 13 '24 14:02 Shaker-Hamdi

Also seeing similar warnings for the DatePanel plugin for minDate and maxDate props.

@shahabyazdi any updates about that one?

melbon avatar Mar 12 '24 07:03 melbon