react-datetime-picker
react-datetime-picker copied to clipboard
Pass name into onChange handler
How do I pass the "name" prop into the onChange handler. It seems to only return the actual date/time which is very limiting.
Hi, since React-DateTime-Picker contains multiple input elements to achieve what it's made for, we couldn't use native event handler. I suggest you to curry your onChange function to achieve what you want:
function makeOnChange(name) {
return function onChange(value) {
return { name, value };
}
}
// Usage:
<DateTimePicker onChange={makeOnChange('myName1')} />
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.
This issue was closed because it has been stalled for 14 days with no activity.