Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to vite 5 and clean up form1 in Example #204

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "rhf-devtools-example",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
Expand All @@ -16,8 +17,8 @@
"devDependencies": {
"@types/react": "^17.0.4",
"@types/react-dom": "^17.0.3",
"@vitejs/plugin-react": "^2.0.0",
"@vitejs/plugin-react": "^4.2.0",
"typescript": "^4.2.4",
"vite": "^3.0.5"
"vite": "^5.0.4"
}
}
1 change: 0 additions & 1 deletion example/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ nav {
nav > a {
appearance: none;
text-decoration: inherit;
text-transform: uppercase;
color: white;
border: 1px solid white;
border-radius: 4px;
Expand Down
14 changes: 8 additions & 6 deletions example/src/forms/Form1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ const Form1: React.FC<{ placement: PLACEMENT }> = ({ placement }) => {
return (
<>
<form onSubmit={handleSubmit((data) => data)}>
<label>First Name</label>
<input {...register('firstName', { required: true })} />
<input {...register('ha.test', { required: true })} />

<label>Last Name</label>
<input {...register('lastName', { required: true })} />
<label>
First Name
<input {...register('firstName', { required: true })} />
</label>

<label>
Last Name
<input {...register('lastName', { required: true })} />
</label>
<input style={{ fontWeight: 400 }} type="submit" />
</form>

Expand Down
Loading