Skip to content

Commit

Permalink
fix: #11 ref 누락 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
leeminhee119 committed Jul 31, 2024
1 parent 26d691b commit da2b1b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/component/common/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type InputProps = {
count?: boolean;
} & React.InputHTMLAttributes<HTMLInputElement>;

export const Input = forwardRef(function ({ id, width = "100%", count, ...props }: InputProps) {
export const Input = forwardRef<HTMLInputElement, InputProps>(function ({ id, width = "100%", count, ...props }, ref) {
const { maxLength, value } = props;
const inputContext = useContext(InputContext);
return (
Expand All @@ -27,6 +27,7 @@ export const Input = forwardRef(function ({ id, width = "100%", count, ...props
`}
>
<input
ref={ref}
id={id || inputContext?.id}
css={css`
width: 100%;
Expand Down
3 changes: 2 additions & 1 deletion src/component/common/input/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type TextAreaProps = {
count?: boolean;
} & React.TextareaHTMLAttributes<HTMLTextAreaElement>;

export const TextArea = forwardRef(function ({ id, width = "100%", height = "8.4rem", count, ...props }: TextAreaProps) {
export const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(function ({ id, width = "100%", height = "8.4rem", count, ...props }, ref) {
const { maxLength, value } = props;
const textareaContext = useContext(InputContext);
return (
Expand All @@ -30,6 +30,7 @@ export const TextArea = forwardRef(function ({ id, width = "100%", height = "8.4
`}
>
<textarea
ref={ref}
id={id || textareaContext?.id}
css={css`
width: 100%;
Expand Down

0 comments on commit da2b1b1

Please sign in to comment.