Skip to content

Commit

Permalink
chore: typeCheck 실패하는 부분을 수정한다
Browse files Browse the repository at this point in the history
  • Loading branch information
pott-101 committed May 31, 2024
1 parent cb93667 commit d39641b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/vibrant-core/src/lib/TextInput/TextInput.native.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
import type { KeyboardTypeOptions, TextInputProps as RNTextInputProps } from 'react-native';
import { TextInput as RNTextInput, StyleSheet } from 'react-native';
import { TextInput as RNTextInput, StyleSheet, NativeSyntheticEvent, TextInputKeyPressEventData } from 'react-native';
import styled from '@emotion/native';
import { createShouldForwardProp } from '../createShouldForwardProp';
import { platform } from '../platform';
Expand Down Expand Up @@ -110,8 +110,8 @@ export const TextInput = forwardRef<TextInputRef, TextInputProps>(

onBlur?.();
}}
onKeyPress={event => onKeyPress?.({ key: event.nativeEvent.key, prevent: () => event.preventDefault() })}
onChangeText={value => {
onKeyPress={(event: NativeSyntheticEvent<TextInputKeyPressEventData>) => onKeyPress?.({ key: event.nativeEvent.key, prevent: () => event.preventDefault() })}
onChangeText={(value: string) => {
const replacedValue = replaceValue({ pattern, value });

let isPrevented = false;
Expand Down
6 changes: 3 additions & 3 deletions packages/vibrant-core/src/lib/TextInput/TextInput.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState, KeyboardEvent, FormEvent } from 'react';
import styled from '@emotion/styled';
import { createShouldForwardProp } from '../createShouldForwardProp';
import type { SystemProps, TextInputProps, TextInputRef } from './TextInputProps';
Expand Down Expand Up @@ -97,7 +97,7 @@ export const TextInput = forwardRef<TextInputRef, TextInputProps>(

onBlur?.();
}}
onKeyDown={event => {
onKeyDown={(event: KeyboardEvent<HTMLInputElement>) => {
const { key } = event.nativeEvent;

if (key === 'Enter') {
Expand All @@ -108,7 +108,7 @@ export const TextInput = forwardRef<TextInputRef, TextInputProps>(

onKeyPress?.({ key, prevent: () => event.preventDefault() });
}}
onInput={event => {
onInput={(event: FormEvent<HTMLInputElement>) => {
const replacedValue = replaceValue({
pattern: type === 'number' ? /\d/ : pattern,
value: event.currentTarget.value,
Expand Down

0 comments on commit d39641b

Please sign in to comment.