I am trying to create a currency conversion site using React, and I’m stuck with a problem. Whenever I type a number inside this input<input value={sourceAmount} onChange={handleSourceAmountChange} type="number" />
I get NaN inside <input type="number" value={targetAmount} readOnly />
.
Here you can see my GitHub repository (https://github.com/Patriciagracia/currency-conversion/tree/master/src). Also, I deployed it on Vercel (https://currency-conversion-gray.vercel.app/).
Could someone offer some guidance on what I might be doing wrong?
Thank you 🙂
I tried adding parseFloat but it didn’t work.
Patricia Gracia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.