How to automatically select a select item in React

Asked

Viewed 225 times

-1

I’m developing a sales record using React and Node. I have an "Edit" button where I call a function that receives an already registered sale and fills the fields for editing, the fields "Sold Hours" and "Sold Value" is already being filled. The select "Project" is not selected according to the sales project because it comes from an array of its own because in select it should contain all the projects in the projects table.

Summarizing I am not using any form library and would like to select an item from select by clicking on "Edit" button. If I’m doing something wrong tell me because I’m new with React. Thank you.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

  • post the code please!

  • It’s really hard to know when all the trouble is happening.

2 answers

0


You are not adding the "value" property in select.

value={projectId)

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.