-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
Version Number
7.64.0
Codesandbox/Expo snack
https://codesandbox.io/p/devbox/lucid-frost-gnfyfx
Steps to reproduce
- Run
tsc
- Receive error:
app/components/tree/tree.tsx:37:37 - error TS2322: Type 'string' is not assignable to type 'never'.
37 const { field } = useController({ name, defaultValue: [] });
~~~~
node_modules/react-hook-form/dist/types/controller.d.ts:20:5
20 name: TName;
~~~~
The expected type comes from property 'name' which is declared here on type 'UseControllerProps<never[], never, never[]>'
app/components/tree/tree.tsx:37:43 - error TS2322: Type 'never[]' is not assignable to type 'undefined'.
37 const { field } = useController({ name, defaultValue: [] });
~~~~~~~~~~~~
node_modules/react-hook-form/dist/types/controller.d.ts:23:5
23 defaultValue?: FieldPathValue<TFieldValues, TName>;
~~~~~~~~~~~~
The expected type comes from property 'defaultValue' which is declared here on type 'UseControllerProps<never[], never, never[]>'
app/components/tree/tree.tsx:46:26 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'.
46 if (value.includes(itemId)) {
~~~~~~
app/components/tree/tree.tsx:47:9 - error TS2322: Type 'string[]' is not assignable to type 'never[]'.
Type 'string' is not assignable to type 'never'.
47 value = without(value, itemId);
~~~~~
app/components/tree/tree.tsx:49:20 - error TS2345: Argument of type 'string' is not assignable to parameter of type 'never'.
49 value.push(itemId);
Expected behaviour
Expect no type errors on minor upgrade.
What browsers are you seeing the problem on?
No response
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
dbca-serkank
Metadata
Metadata
Assignees
Labels
No labels