Skip to content

Commit

Permalink
♻️ Refactor: 로그인, 회원가입, 프로필에 쓰일 controller 커스텀훅 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
sy-paik committed Nov 6, 2023
1 parent 60be1ba commit 5897dbe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/hook/useFieldController.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { useController } from 'react-hook-form';

export function useFieldController(fieldName, control, rules) {
const fieldController = useController({
name: fieldName,
control,
rules,
});

return fieldController;
}

0 comments on commit 5897dbe

Please sign in to comment.