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.
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.
Editor Picks
October 3, 2024
2.1kAn app that helps individuals track their daily carbon footprint, offering personalized tips to reduce emissions and rewarding eco-friendly actions with points redeemable for discounts from sustainable brands.
October 12, 2024
233A mobile app that provides users with personalized meal plans, nutrition tracking, and wellness coaching, using AI to analyze dietary preferences and health goals, while offering community support and expert advice.