hydrogen
hydrogen copied to clipboard
[BUG] FormProps interface does not reflect <Form> props passthrough
Describe the bug
The <Form> component passes all additional props to the created <form> element, but the FormProps interface does not reflect this, only accepting the specified props. This makes it difficult to style the underlying <form> element when using TypeScript, as passing it a className will cause a type checking error.
To Reproduce
https://stackblitz.com/edit/shopify-hydrogen-aumbi2?file=src/App.server.tsx
<Form action="" className="">
{/* ~~~~~~~~~ :( */}
</Form>
Expected behaviour
FormProps to extend HTMLAttributes<HTMLFormElement> or to have an index signature so that additional props can be passed in to be applied to the <form> element it contains.
Additional context Hydrogen version: 1.5.0
Relevant: #1927