JSX React HTML5 Input Slider Doesn't Work

后端 未结 5 1569
陌清茗
陌清茗 2021-01-31 02:48

I\'m using React.JS for a build, and am building a range input slider with two choices for a component.

this is my code:



        
5条回答
  •  北恋
    北恋 (楼主)
    2021-01-31 03:47

    I hope the above solutions might have resolved your issue, I have one simple approach using hooks.

    const RangeSlider = () => {
    
      const [rangeval, setRangeval] = useState(null);
    
      return (
        
    setRangeval(event.target.value)} />

    The range value is {rangeval}

    ); }; export default RangeSlider;

提交回复
热议问题