Company
Date Published
Author
Irene Morente
Word count
1510
Language
English
Hacker News points
2

Summary

Netlify now offers free form handling, allowing sites to process form submissions without server-side code. To integrate this feature, add a `netlify` attribute to the HTML form tag and a hidden `form-name` field in the JSX form. For static site generators like Gatsby or React-Static, the build tool will generate the static HTML form automatically, requiring only the addition of the `data-netlify` attribute and a hidden `form-name` field. A stateful React form requires additional code to handle the POST request, including encoding the form data and sending it to the site's root path with the correct headers.