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

180
Views
bundle.js:21632 Warning: Received NaN for the `value` attribute. If this is expected, cast the value to a string

I'm making a react app, I have 3 inputs(champ1, champ2, champ3) where I type values and I get the sum of them in another one, and that sum is used in a formula that's calculated in another input.

I get this error: "Warning: Received NaN for the value attribute. If this is expected, cast the value to a string." when I type and clear the inputs, it reads an empty value, what can I do to prevent that?

Here's my code:

const [input, setInput] = React.useState({
    champ2: 0,
    champ4: 0,
    champ6: 0,
});
const [sum, setSum] = React.useState(0)
const [eau, setEau]=React.useState(0)


useMemo(() => {
  
    setSum(parseInt(input.champ2) + parseInt(input.champ4) + parseInt(input.champ6))
  
}, [input])

useMemo(() =>{
  setEau(sum*0.02*4*8000)
},[sum])

//handle input change 



const handleInput=function(e){

    setInput({
      ...input, 
      [e.target.name]: e.target.value
  });
  
}
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!