import React, { useState, useEffect } from 'react'; import Box from '@mui/material/Box'; import TextField from '@mui/material/TextField'; const SelectTextFields = (props) => { const [currency, setCurrency] = useState(props.emptyField ? '0' : '1'); if(props.emptyField){ props.currencies.push({ 'value': 0, 'label': ''}) } useEffect(()=>{ props.func(currency); },[currency, props]) const handleChange = (event) => { setCurrency(event.target.value); }; return ( {props.currencies.map((option, index) => ( {option.label} ))} ); } export default SelectTextFields /* return ( {currencies.map((option) => ( {option.label} ))} {currencies.map((option) => ( {option.label} ))} {currencies.map((option) => ( {option.label} ))} {currencies.map((option) => ( {option.label} ))} {currencies.map((option) => ( {option.label} ))} {currencies.map((option) => ( {option.label} ))} ); */