feat: attempt to fix the crud with auth
This commit is contained in:
20
contexts/FormField/FormFieldProvider.tsx
Normal file
20
contexts/FormField/FormFieldProvider.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import {
|
||||
Controller,
|
||||
ControllerProps,
|
||||
FieldPath,
|
||||
FieldValues
|
||||
} from 'react-hook-form';
|
||||
import { FormFieldContext } from './FormFieldContext';
|
||||
|
||||
export const FormField = <
|
||||
TFieldValues extends FieldValues = FieldValues,
|
||||
TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>
|
||||
>({
|
||||
...props
|
||||
}: ControllerProps<TFieldValues, TName>) => {
|
||||
return (
|
||||
<FormFieldContext.Provider value={{ name: props.name }}>
|
||||
<Controller {...props} />
|
||||
</FormFieldContext.Provider>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user