Set dynamic input fields in React
Example for Input type text: const [ videoUrls , setVideoUrls ] = useState ([{ id : 0 , url : '' }]) const addVideoField = () => { setVideoUrls ([ ... videoUrls , { id : videoUrls . length , url : '' }]) } const handleVideoUrlChange = ( id , value ) => { const updatedUrls = videoUrls . map ( video => ( video . id === id ? { ... video , url : value } : video )) setVideoUrls ( updatedUrls ) < div id = '' > < Grid container direction = 'row' alignItems = 'normal' spacing = { 4 } sx = { { pl : 5 , pr : 5 , pt : 3 , pb : 2 } } > < Grid item sm = { 12 } sx = { { pl : 5 , pr : 5 , pt : 3 , pb : 2 } } > { videoUrls . map (( field , ...