score:0

you need to add the state being controlled as a 'value' prop to both components, to have them syncronised.

<slider
  value={currentvalueradio} // <- add a value prop
  defaultvalue={2021}
  ...

adding the value prop in your example will have both components react to the same state value. however, since the radio components set the value to 1 or 2, and the range on the slider is from 2021 to 2022, you may not see the result you're looking for. perhaps change the radio values to 2021 and 2022 respectively.


Related Query