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

162
Views
How can I convert the material ui range sliders output(newValue) to string

I have started using the Material UI library recently. I have used Range slider component. I am handling the change using the handleChange function. Which has 2 arguments event and newValue. When I logged out newValue I got an array with 2 number elements.

The issue is I want the newValue as string

So to do that applied toString() method on the newValue but it gave me an error on Changing the silder position that Failed prop type: Invalid prop value supplied to ForwardRef(Slider), expected one of type [number].

This is the default code snippet

    const handleAgeChange = (event, newValue) => {
        setValue({ ...value, ageRange: newValue })
    };

and this is the one in which I used toString() method

    const handleAgeChange = (event, newValue) => {
        setValue({ ...value, ageRange: newValue.toString() })
    };
about 4 years ago · Juan Pablo Isaza
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!