Tür 'HTMLFormControlsCollection' hayır özelliği 'x' ve hiçbir dize endeksi imzası

oy
0

Bir destructure çalışırken bu hata görünür form.elementsnesne.

// in a class

domRefs: {[key: string]: HTMLFormElement | null} = {
  myForm: null
}

onButtonClick = () => {
  console.debug(this.domRefs.myForm!.elements) // screenshot below
  const {a, b, c} = this.domRefs.myForm!.elements
}

Burada

Ben kullanmak istemiyorum : anybu hatayı yaymaz türü.

Oluştur 02/04/2018 saat 11:48
kaynak kullanıcı
Diğer dillerde...                            

Cookies help us deliver our services. By using our services, you agree to our use of cookies. Learn more