How To Change Number To String While Submitting The Data Using Reactjs
My objective is to change the value of variable while submitting the data. Here is the array: experiences: [ { Organisation: '', Id: '', From: '',
Solution 1:
Try changing val to ${val}
Have you tried using a template literal? – Mason Curtis
Solution 2:
This may not be the perfect solution but maybe worth giving a go.
Try using a template literal as in...
let myNewStr = `${numToBeConverted}`
Then save myNewStr
into the DB instead of the string.
You can also do ${numToBeConverted}
by itself.
For example:
Instead of doing value.toString()
you'd do
`${value}`
Post a Comment for "How To Change Number To String While Submitting The Data Using Reactjs"