Home > Blockchain >  how to get the value the auto complete in the form
how to get the value the auto complete in the form

Time:12-26

I try to get the value of autocomplete in console.log()

it's posible to get the value of autocomplete after selection of title ?

find below code source

https://stackblitz.com/edit/react-tewwbp?file=demo.js [code source[1]

CodePudding user response:

You are currently using uncontrolled Autocomplete so you don't have access to the value that is currently selected. To console the value you can use something like this:

<Autocomplete    
onChange={(event, newValue) => {
        console.log(newValue);
     // setValue(newValue);
    }}
...
/>
  • Related