Skip to content

Commit

Permalink
refactor: useStringInput 초기값 타입 추론 개선 및 반환 객체 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
bytrustu committed Mar 6, 2024
1 parent f1a4e77 commit b6d8a1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hook/useStringInput.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { useState } from 'react';

export const useStringInput = (initialStringValue: string = '') => {
export const useStringInput = (initialStringValue = '') => {
const [stringValue, setStringValue] = useState(initialStringValue);

const handleChange = (value: string) => {
setStringValue(value);
};

return { value: stringValue, setValue: setStringValue, handleChange };
return { value: stringValue, handleChange };
};

0 comments on commit b6d8a1d

Please sign in to comment.