Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

useTypedController render prop signature does not contain name and ref props #29

Open
lionskape opened this issue Mar 7, 2021 · 3 comments

Comments

@lionskape
Copy link

lionskape commented Mar 7, 2021

Here is the root of the problem:

strictly-typed/src/types.ts

Lines 145 to 149 in 382a93a

render?: (props: {
onChange: (...event: any[]) => void;
onBlur: () => void;
value: DeepPathValue<TFieldValues, TFieldName>;
}) => React.ReactElement;

Expected behavior:
render function argument contains name ref declaration

Current behavior:
render function argument does not contain ref and name declaration

Probably solution should look like this:

    render?: (props: {
      onChange: (...event: any[]) => void;
      onBlur: () => void;
      value: DeepPathValue<TFieldValues, TFieldName>;
      name: TFieldName;
      ref: React.MutableRefObject<TAs>;
    }) => React.ReactElement;
@bluebill1049
Copy link
Member

hook form v7 should make input name strict by default.

@lionskape
Copy link
Author

Does it mean, that this package will be deprecated soon?

@bluebill1049
Copy link
Member

Will not be relevant for v7.

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

No branches or pull requests

2 participants