I import MultiRangeSlider in react which asks for a "ChangeResult" module which only works with tsx but all other files are in jsx. I would like to avoid modifying all my application. See line 27
import MultiRangeSlider, { ChangeResult } from 'multi-range-slider-react'
import React, { useState } from 'react'
export default function Memory({ setFilters }) {
const memoryDimension = ['4', '8', '16', '32', '64']
const [minValue, setMinValue] = useState(0)
const [maxValue, setMaxValue] = useState(0)
const [minValue2, setMinValue2] = useState(0)
const [maxValue2, setMaxValue2] = useState(0)
const [minCaption, set_minCaption] = useState('')
const [maxCaption, set_maxCaption] = useState('')
return (
<div className="filters">
<div className="filter display-processeur">
<h1>Mémoire</h1>
<div className="display-processor-intel-amd">
<div className="display-filter-by-gamme-core">
<MultiRangeSlider
title="memory-dimension"
min={0}
max={5}
step={1}
minValue={1}
maxValue={4}
onInput={(e: ChangeResult) =>{
set_minCaption(memoryDimension[e.minValue])
set_maxCaption(memoryDimension[e.maxValue])
setMinValue(e.minValue)
setMaxValue(e.maxValue)
}}
onChange={(e) => {
setMinValue2(e.minValue)
setMaxValue2(e.maxValue)
}}
labels={memoryDimension}
ruler={false}
style={{
border: 'none',
boxShadow: 'none',
padding: '15px 10px',
}}
barLeftColor="red"
barInnerColor="blue"
barRightColor="green"
thumbLeftColor="lime"
thumbRightColor="lime"
/>
</div>
</div>
</div>
</div>
)
}
I tried to create a function that overrides the ChangeResult module but failed.