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

409
Views
TypeError: Cannot assign to read only property '1' of object '

I will start by saying: I know that this question have been asked several times here on the site.

I'm still asking because not all of the errors i found matched mine, and all of them didn't stem from the same reasons, so at the end of it, i still remained with no clue for any solution.

Now, for the problem itself:

I have a React app, and i have this object:

let Ellipse = {
  radii: ['', ''],
  coordinates: ['', ''],
  tilt: ['']
}

The object is defined outside the main function, which means that the program looks something like this:

let Ellipse = {
  radii: ['', ''],
  coordinates: ['', ''],
  tilt: ['']
}

export default function App() {
  const handleForm = (e) => {
      Ellipse.coordinates[0] = parseInt(e.target.value);
}

return (
<TextField required onChange={handleForm}/>
);}

The problem is that on the first time when i try to wirte something on the textfield everything is fine, but on the second time it's just getting freaked out, and the console (on the chrome dev tools) is coming out with the error that i've mentioned in the title:

Uncaught TypeError: Cannot assign to read only property '0' of object '[object Array]'

PLS HELP!

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!