Skip to main content

Function: useDayRender

useDayRender(day, displayMonth, buttonRef): DayRender

Return props and data used to render the Day component.

Use this hook when creating a component to replace the built-in Day component.

Each Day in DayPicker should render one of the following, according to the return value:

  • an empty React.Fragment, to render if isHidden is true
  • a button element, when the day is interactive, e.g. is selectable
  • a div element, whe the day is not interactive

Parameters

NameTypeDescription
dayDateThe date to render
displayMonthDateThe month where the date is displayed (if not the same as date, it means it is an "outside" day)
buttonRefRefObject<HTMLButtonElement>A ref to the button element that will be target of focus when rendered (if required).

Returns

DayRender

Defined in

hooks/useDayRender/useDayRender.tsx:56