Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
react hook form with Slider and Input

I need to get same value from Slider when I move it and from Input when I enter new value but it doesnt work correct

                            <StyledSlider
                            {register(NAMES.AMOUNT)}
                            defaultValue={5000}
                            value={typeof value === 'number' ? value : 5000}
                            min={5000}
                            max={50000}
                            onChange={handleSliderChange(NAMES.AMOUNT)}
                        />
                        <StyledLabel>
                            <StyledInput
                            {register(NAMES.AMOUNT)}
                                value={value}
                                onChange={handleInputChange(NAMES.AMOUNT)}
                                onBlur={handleBlur}
                                disableUnderline={true}
                            />
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The range input's value type is a string, and you have set up a type check with a fallback for 5000.

If the state handling is set up properly, you only have to use value={value}.

Check out the related MDN page here.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!