react-multi-date-picker
react-multi-date-picker copied to clipboard
Warnings while using custom component
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:
-
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 lowercaseopencalendar
instead. If you accidentally passed it from a parent component, remove it from the DOM element. -
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 lowercasehandlevaluechange
instead. If you accidentally passed it from a parent component, remove it from the DOM element.
@shahabyazdi, can you help me please?
I also have the same issue :/
Please upgrade to v4.1.1, this will fix the problem. Thank you.
Hi! Still reproduced((
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 - 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
Also seeing similar warnings for the DatePanel plugin for minDate
and maxDate
props.
I have the same issue, I'm on version 4.4.1, and the issue happens when using render={ <Icon /> }
Also seeing similar warnings for the DatePanel plugin for
minDate
andmaxDate
props.
@shahabyazdi any updates about that one?