Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`useForm`: support client-side validation (or at least `setError`)

Open
#525 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
54/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
frontend

Research direction

Start by locating the useForm implementation and its tests in the @void/react package; the issue does not name specific files. Trace how errors, clearErrors, and setData are handled, then check how server validation maps errors into the form. Done means the chosen proposal works through form.errors and has tests for setting errors and, if implemented, clearing them on change.

Written by the indexing model from the issue text.

Description

Version

void / @void/react 1.1.12

Problem

useForm only fills errors from the server's withValidator() response. There's no way to validate in the browser and show errors through the same errors object:

  • there's no setError / setErrors, only clearErrors,
  • the Zod schema already used in withValidator() can be run on the client by hand, but its results can't be wired into form.errors,
  • errors don't clear when a field changes, so each onChange needs its own clearErrors(field) call.

As a result, apps that want inline validation as the user types either keep a second error state next to form.errors, or switch to another form library and lose useForm's typed action URL, pending and server error mapping.

Proposal

Any of these, from smallest to largest:

  1. setError(field, message): lets apps run their own validation and show the result through form.errors.
  2. An option to clear a field's error on change, e.g. clearErrorsOnChange: true, so setData(field, …) also clears errors[field].
  3. Optional client-side validation with the action's schema, e.g. useForm(url, defaults, { validate: createNoteSchema, validateOn: 'blur' | 'change' }). That would give the same messages in the browser and on the server, from one schema.

(1) and (2) are small and unblock building (3) in userland.

Related: #523, #524

Dominant language
TypeScript
Stars
402
Forks
32
Avg merge
10h 18m
Merged PRs (30d)
113

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from voidzero-dev/void

All issues in voidzero-dev/void

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.