{"id":21667264,"url":"https://github.com/smailen5/react-form-exercise","last_synced_at":"2026-04-11T06:02:45.009Z","repository":{"id":238917318,"uuid":"797893446","full_name":"Smailen5/react-form-exercise","owner":"Smailen5","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-10T16:37:28.000Z","size":103,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-26T00:04:12.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Smailen5.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-08T17:30:28.000Z","updated_at":"2024-05-10T16:37:31.000Z","dependencies_parsed_at":"2024-05-08T21:43:06.377Z","dependency_job_id":"f32f8482-9879-4ee2-9eb6-0943057602b7","html_url":"https://github.com/Smailen5/react-form-exercise","commit_stats":null,"previous_names":["smailen5/react-form-exercise"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Smailen5/react-form-exercise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smailen5%2Freact-form-exercise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smailen5%2Freact-form-exercise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smailen5%2Freact-form-exercise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smailen5%2Freact-form-exercise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Smailen5","download_url":"https://codeload.github.com/Smailen5/react-form-exercise/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smailen5%2Freact-form-exercise/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261973725,"owners_count":23238586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T11:35:50.102Z","updated_at":"2025-12-30T22:24:19.122Z","avatar_url":"https://github.com/Smailen5.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Form sample\n\n- Esercizio form per React utilizzando react hook form\n\n# Obbiettivi\n\n- validazione per ogni campo\n- utilizzo della libreria react-hook-form\n- rendere esteticamente bella la pagina\n\n# Roba installata\n\n- react (vedi installazione ufficiale vite+react)\n- tailwind (vedi installazione tailwind ufficiale per vite)\n- `npm i react-hook-form`\n- `npm i -D @hookform/devtools`\n\n# Codice usato\n\nQuesto va bene ma e possibile usare un oggetto per passarli piu proprieta:\n```js\nvalidate: (fieldValue) =\u003e {\n    return (\n    fieldValue !== \"admin@example.com\" ||\n    \"Inserisci una email diversa\"\n    );\n}\n```\n\nRicorda di aggiungere \n```js\n\u003cDevTool control={control} /\u003e\n```\nalla fine del form, ricorda inoltre che devi passare `{ control }` a chi sta usando `useFrom()`\n\n- Nel form puoi usare `{ valueAsNumber: true }` o `{ valueAsDate: true }` per cambiare direttamente i valori da stringa \n\nPuoi passare come argomento anche un array a `watch(['username', 'email'])`\n\n\n# Links utili\n\n- Documentazione [React hook form](https://react-hook-form.com/get-started)\n- regex per validazione email [regexr.com](https://regexr.com/3e48o)\n- Dati di esempio [jsonplaceholder](https://jsonplaceholder.typicode.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmailen5%2Freact-form-exercise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmailen5%2Freact-form-exercise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmailen5%2Freact-form-exercise/lists"}