How to use the @datepicker-react/hooks.useDay function in @datepicker-react/hooks

To help you get started, we’ve selected a few @datepicker-react/hooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tresko / react-datepicker / packages / styled / src / components / Day / Day.tsx View on Github external
function Day({day, date}: DayProps) {
  const dayRef = useRef(null)
  const {
    focusedDate,
    isDateFocused,
    isDateSelected,
    isDateHovered,
    isDateBlocked,
    isFirstOrLastSelectedDate,
    onDateSelect,
    onDateFocus,
    onDateHover,
    onDayRender,
  } = useContext(datepickerContext)

  const dayProps = useDay({
    date,
    focusedDate,
    isDateFocused,
    isDateSelected,
    isDateHovered,
    isDateBlocked,
    isFirstOrLastSelectedDate,
    onDateFocus,
    onDateSelect,
    onDateHover,
    dayRef,
  })

  const themeContext = useContext(ThemeContext)
  const white = getThemeProp('white', globalStyles.colors.white, themeContext)
  const mud = getThemeProp('mud', globalStyles.colors.mud, themeContext)

@datepicker-react/hooks

React hooks for datepicker.

MIT
Latest version published 3 years ago

Package Health Score

59 / 100
Full package analysis