I have multiple dynamic forms on the client that use this component
<Form method="post">
<Flex>
<Button type="submit">Create {model} </Button>
<Button>Read {model}</Button>
<Button>Update {model}</Button>
<Button>Delete {model}</Button>
</Flex>
{Object.keys(fields).map((key) => (
<Input
key={key}
name={key}
placeholder={"Insert " + key}
/>
))}
</Form>
The Inputs are dynamic and I want to process the values on the server onSubmit.
The docs show we can get values using the get function:
export const action = async ({ request}) => {
const form = await request.formData();
console.log(form.get("name"));
return json({ message: `test` });
};
But how do I get all the values without hardcoding the "name" key