Skip to content

Commit 9720a1c

Browse files
authored
update vite and clean up form1 (#204)
1 parent 34e2e2e commit 9720a1c

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

example/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "rhf-devtools-example",
33
"private": true,
4+
"type": "module",
45
"scripts": {
56
"dev": "vite",
67
"build": "tsc && vite build",
@@ -16,8 +17,8 @@
1617
"devDependencies": {
1718
"@types/react": "^17.0.4",
1819
"@types/react-dom": "^17.0.3",
19-
"@vitejs/plugin-react": "^2.0.0",
20+
"@vitejs/plugin-react": "^4.2.0",
2021
"typescript": "^4.2.4",
21-
"vite": "^3.0.5"
22+
"vite": "^5.0.4"
2223
}
2324
}

example/src/App.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ nav {
112112
nav > a {
113113
appearance: none;
114114
text-decoration: inherit;
115-
text-transform: uppercase;
116115
color: white;
117116
border: 1px solid white;
118117
border-radius: 4px;

example/src/forms/Form1.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ const Form1: React.FC<{ placement: PLACEMENT }> = ({ placement }) => {
2828
return (
2929
<>
3030
<form onSubmit={handleSubmit((data) => data)}>
31-
<label>First Name</label>
32-
<input {...register('firstName', { required: true })} />
33-
<input {...register('ha.test', { required: true })} />
34-
35-
<label>Last Name</label>
36-
<input {...register('lastName', { required: true })} />
31+
<label>
32+
First Name
33+
<input {...register('firstName', { required: true })} />
34+
</label>
3735

36+
<label>
37+
Last Name
38+
<input {...register('lastName', { required: true })} />
39+
</label>
3840
<input style={{ fontWeight: 400 }} type="submit" />
3941
</form>
4042

0 commit comments

Comments
 (0)