This one-page TypeScript app using React accepts user input and uploads the data to an API endpoint.
If your endpoint works, and the fields match, you'll be able to save the data.
This code has been confirmed to work with my own personal API endpoint (not included). You would need to adapt the data fields for a different API endpoint.
This app is written in TypeScript, with React. It shows a form where the user can enter their data, press Submit, and send the data to the API.
If the submission is successful, the user will be thanked and told we'll be in touch. If not, the reason for the failure is given.
If you don't have an API endpoint to upload to, you can use the form and submit data, but you'll receive a message saying the API request was not successful (which is fine if all you want to do is see how it works).
To compare this TypeScript code to similar JavaScript code also using React for the same purpose, see this gist and this blog post explaining how to make an email submit form with JS.
In the project directory, you can run:
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
This app was created with Create React App using React.
Other TypeScript apps: clock.