UNPKG

634 BJavaScriptView Raw
1import React from "react";
2/**
3 * Render the button for a day in the calendar.
4 *
5 * When not interactive, DayPicker will render a `DayContent` component instead
6 * of a `DayButton` component.
7 *
8 * @group Components
9 * @see https://daypicker.dev/guides/custom-components
10 */
11export function DayButton(props) {
12 const { day, modifiers, ...buttonProps } = props;
13 const ref = React.useRef(null);
14 React.useEffect(() => {
15 if (modifiers.focused)
16 ref.current?.focus();
17 }, [modifiers.focused]);
18 return React.createElement("button", { ref: ref, ...buttonProps });
19}
20//# sourceMappingURL=DayButton.js.map
\No newline at end of file