I have a page presenting sales offers, I would like to add to my list a filter on the year with a slider whose minimum corresponds to the smallest year of my offers and the maximum with the largest year my offers
My problem is that on my slider I have the value "Nan" which appears on the minimum ... I specify that I am starting with react-redux
const [year, setYear] = useState([filters.year.year__min,filters.year.year__max])
code
const handleChange = (event, newValue) => {
setYear(newValue);
};
code
function valuetext(value) {
return `${year}`;
}
code
<Slider
defaultValue={year}
onChange={handleChange}
valueLabelDisplay="auto"
aria-labelledby="range-slider"
getAriaValueText={valuetext}
min={filters.year.year__min}
max={filters.year.year__max}
thanks for your help :)