Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

414
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda