nexxtway/react-rainbow

View on GitHub
src/components/MonthlyCalendar/hooks/useYearsRange.js

Summary

Maintainability
A
1 hr
Test Coverage
import { useMemo } from 'react';
import { getYearsRange } from '../../Calendar/helpers';

export default function useYearsChange(minDate, maxDate, month) {
    return useMemo(
        () =>
            getYearsRange({
                minDate,
                maxDate,
                currentMonth: month.getMonth(),
            }),
        [minDate, maxDate, month],
    );
}