You must use a map instead of foreach because forEach returns nothing, so the form elements are not rendered.
Here is an example :
https://codesandbox.io/p/sandbox/kind-bouman-59l8qc?file=%2Fsrc%2FApp.js