-2

I am trying to get access to the items of an object, called verein. The corresponding code is:

export function TestForm(verein) {
    console.log(verein);
    console.log(verein.Verein_Name); // I try to get "Eschweiler Kanu Club e.V.

  return;
}

The output is:

0
: 
{id: 2, Verein_Name: 'Eschweiler Kanu Club e.V.', Verein_Kurz: 'EKC', Verein_Strasse: 'Ardennenstr. 82', Verein_PLZ: '52076', …}
length
: 
1
[[Prototype]]
: 
Array(0)

I try to access the values of the object, but I haven't found a way to get them. I want to fill some input fields of prime react/inputfields.

    <span className="p-float-label">
       <InputText id="in" value={verein.Vereins_Name} disabled={isDisabled} />
       <label htmlFor="in">Vereinsname</label>
Phil
  • 157,677
  • 23
  • 242
  • 245

1 Answers1

0

It's an array. Therefore

console.log(verein[0].Verein_Name)
mbojko
  • 13,503
  • 1
  • 16
  • 26