June 9, 2025

Dummy Pitch

formAction: Can be used in a <button> or <input type="submit"> fields to override the action prop. Next.js will perform a client-side navigation, however, this approach doesn't support prefetching.

image

Pitch Details

formAction: Can be used in a <button> or <input type="submit"> fields to override the action prop. Next.js will perform a client-side navigation, however, this approach doesn't support prefetching. When using basePath, you must also include it in the formAction path. e.g. formAction="/base-path/search". key: Passing a key prop to a string action is not supported. If you'd like to trigger a re-render or perform a mutation, consider using a function action instead. onSubmit: Can be used to handle form submission logic. However, calling event.preventDefault() will override <Form> behavior such as navigating to the specified URL. method, encType, target: Are not supported as they override <Form> behavior. Similarly, formMethod, formEncType, and formTarget can be used to override the method, encType, and target props respectively, and using them will fallback to native browser behavior. If you need to use these props, use the HTML <form> element instead. <input type="file">: Using this input type when the action is a string will match browser behavior by submitting the filename instead of the file object.