im new in Node, JavaScript and React. I must show a list of data inside a dropdown, then the selected one save it in the database. The problem is how to display the list of data to select
In this way they capture the data
<div className="p-field p-col">
<label className="p-col-fixed" htmlFor="to">Columna final </label>
<div className="p-col">
<Dropdown id={'to'} appendTo={document.body} value={selectedStatusTo} options={props.statuses} onChange={(e) => setSelectedStatusTo(e.value)} optionLabel="name" placeholder="Seleccione Estado"/>
</div>
</div>
I understand that value is the selected value of the dropdown and that I must save later, but how do I pass a different array in Options
const arra = [{name:"hello0"},{name:"hello1"},{name:"hello2"},{name:"hello3"}];
<div>
<h5>Tipo de reparto</h5>
<hr/>
<div className="p-fluid p-formgrid p-grid">
<div className="p-field p-col">
<label className="p-col-fixed" htmlFor="from">Reparto</label>
<div className="p-col">
<Dropdown id={'type'} appendTo={document.body} value={selectedStrategy} options={arra} onChange={(e) => setStrategy(e.value)} optionLabel="name" placeholder="Seleccione Tipo Reparto"/>
</div>
</div>
</div>
</div>