vercel-labs / vercel-labs/json-render

Errors in the document about the useFieldValidation

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
16.8k
Forks
901
Avg merge
3h 14m
Merged PRs (30d)
4

Description

the document:

import { useFieldValidation } from '@json-render/react';

function TextField({ props }) {
  const { value, setValue, errors, validate } = useFieldValidation(
    props.valuePath,
    props.checks
  );

  return (
    <div>
      <label>{props.label}</label>
      <input
        value={value || ''}
        onChange={(e) => setValue(e.target.value)}
        onBlur={() => validate()}
      />
      {errors.map((error, i) => (
        <p key={i} className="text-red-500 text-sm">{error}</p>
      ))}
    </div>
  );
}

but i got error, and i reviewed the type,there is no 'value'、'setValue'
Image

and i want to use form validation,do I need to make any configuration for the catalog?

I would like to know on what basis LLM generates the verification conditions.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with the document section containing the useFieldValidation example and compare it with the hook's exported type, especially the values shown in the issue. Clarify the valid usage and document whether catalog configuration is required for form validation. Also explain, based on the documented API, how validation conditions are determined.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.