Skip to content

Commit d591790

Browse files
committed
Update docs
1 parent a5557d3 commit d591790

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
<h1 align="center" width="100%">
42
Typed React form
53
</h1>
@@ -13,7 +11,6 @@
1311
<a href="https://bundlephobia.com/result?p=typed-react-form"><img alt="NPM Size" src="https://img.shields.io/bundlephobia/minzip/typed-react-form" /></a>
1412
</p>
1513

16-
1714
- ✔️ **Completly type-checked**: make less errors, this library was built for Typescript. Supports nested objects/arrays.
1815
- 🤔 **Simple**: An intuitive, unclottered and easy to understand api. Well [documented](https://codestix.github.io/typed-react-form/) too (+JSDoc).
1916
- :fire: **Fast**: only rerenders the fields that change. This allows you to create huge forms.

docs/index.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ function MyForm() {
3636
}
3737
```
3838

39-
<iframe src="https://codesandbox.io/embed/basic-typed-react-form-example-zz7uw?fontsize=14&hidenavigation=1&theme=dark"
39+
<!-- <iframe src="https://codesandbox.io/embed/basic-typed-react-form-example-zz7uw?fontsize=14&hidenavigation=1&theme=dark"
4040
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
4141
title="basic typed-react-form example"
4242
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
4343
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
44-
></iframe>
44+
></iframe> -->
4545

4646
### Creating the submit handler
4747

@@ -56,14 +56,15 @@ function MyForm() {
5656
const form = useForm({ email: "" });
5757

5858
function submit() {
59-
// The form.handleSubmit validates the form before calling this function
59+
// You don't have to use form.handleSubmit, it just validates
60+
// your form before calling this function
6061
console.log("submit", form.values);
6162
}
6263

63-
// Use the standard html form element, which exposes the onSubmit event.
64+
// Use the standard html form element, which has the onSubmit event.
65+
// Make sure to add type="submit" to your submit button
6466
return (
6567
<form onSubmit={form.handleSubmit(submit)}>
66-
{/* Make sure to add type="submit" */}
6768
<button type="submit">Submit!</button>
6869
</form>
6970
);

0 commit comments

Comments
 (0)