如何将 react 中输入类型='date' 中的默认浏览器按钮替换为自定义按钮以模仿相同的操作?



因此,我正在尝试使用输入type='date'设计一个自定义日期选择器。我想用自定义按钮替换默认的日历图标。我应该如何为按钮编写onClick处理程序来设置输入字段中的值。此外,占位符似乎不适用于日期输入,有其他选择吗?

<input type = 'date' placeholder='Enter Date'(doesn't work) onChange={} />
<CalendarButton onClick={} />

input[type="date"]::-webkit-calendar-picker-indicator{
content: url(https://img.icons8.com/color/344/calendar--v2.png);
}
input[type='date']:before{
content: attr(placeholder)
}
input::-webkit-datetime-edit{
display: none;
}
<input type = 'date' placeholder='Enter Date' onChange={} />