NextJs / Form / Billing form
Billing form
-
1. Files
); }; export default BillingForm;import { useState } from 'react'; const BillingForm = () => { const [items, setItems] = useState([ { itemName: '', quantity: 0, price: 0 }, ]); const handleItemChange = (index, event) => { const { name, value } = event.target; const newItems = [...items]; newItems[index][name] = value; setItems(newItems); }; const addNewItem = () => { setItems([...items, { itemName: '', quantity: 0, price: 0 }]); }; const handleSubmit = (event) => { event.preventDefault(); // Handle form submission with items data console.log(items); }; return (