I'm quite new to ReactJS and i have a question. I have this add product code, which is basically a form that can add a product of certain values. My goal is that everytime i hit the "Create Button" the details from the form are saved into a json file, so that ill be able to fetch them and display them.
Would anyone be able to help with that?
import "./newProduct.css";
export default function NewProduct() {
return (
<div className="newProduct">
<h1 className="addProductTitle">New Product</h1>
<form className="addProductForm">
<div className="addProductItem">
<label>Image</label>
<input type="file" id="file" />
</div>
<div className="addProductItem">
<label>Name</label>
<input type="text" placeholder="Apple Airpods" />
</div>
<div className="addProductItem">
<label>Stock</label>
<input type="text" placeholder="123" />
</div>
<div className="addProductItem">
<label>Active</label>
<select name="active" id="active">
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</div>
<button className="addProductButton">Create</button>
</form>
</div>
);
}