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('0'); props.currencies.push({ 'value': 0, 'label': ''}) useEffect(()=>{ props.func(currency); }, [currency]) // props.func(currency); 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} ))} ); */