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

Documentation - "get" method #80

Closed
asotog opened this issue Apr 26, 2021 · 3 comments
Closed

Documentation - "get" method #80

asotog opened this issue Apr 26, 2021 · 3 comments

Comments

@asotog
Copy link

asotog commented Apr 26, 2021

Hi,

just found in ErrorMessagethere exists a get method for digging into objects especially errors and retrieve nested values, is there any plan to document this in the API docs?

import * as React from 'react';
import { useFormContext, get, FieldErrors } from 'react-hook-form';
import { Props } from './types';

can be used like

 const error = get(errors || methods.formState.errors, name);

This is useful when handling complex nested forms, right now documentation does not expose all the power of react hooks forms utils.
My favorite forms library by far...
Thanks in advance,

@bluebill1049
Copy link
Member

hey @asotog thanks for the kind words, please use load dash get instead, hook form get is limited to internal use only. hence we don't document it.

@asotog
Copy link
Author

asotog commented Apr 26, 2021

hey @asotog thanks for the kind words, please use load dash get instead, hook form get is limited to internal use only. hence we don't document it.

that's good idea thanks

@bluebill1049
Copy link
Member

np :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants