Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

424
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda