fix(striker-ui): remove type ReactChangeEventHandler

main
Tsu-ba-me 1 year ago
parent 92cae194c9
commit 0429c76294
  1. 8
      striker-ui/components/UncontrolledInput.tsx
  2. 5
      striker-ui/types/UncontrolledInput.d.ts

@ -54,7 +54,9 @@ const UncontrolledInput = forwardRef(
const [value, setValue] = useState<MapToInputType[ValueType]>(inputValue);
const baseChangeEventHandler = useCallback<ReactChangeEventHandler>(
const baseChangeEventHandler = useCallback<
React.ChangeEventHandler<HTMLInputElement>
>(
({ target: { [valueKey]: changed } }) => {
const converted = MAP_TO_VALUE_CONVERTER[valueType](
changed,
@ -65,7 +67,9 @@ const UncontrolledInput = forwardRef(
[valueKey, valueType],
);
const changeEventHandler = useCallback<ReactChangeEventHandler>(
const changeEventHandler = useCallback<
React.ChangeEventHandler<HTMLInputElement>
>(
(...args) =>
onChange?.call(
null,

@ -1,8 +1,5 @@
type MuiInputBaseProps = import('@mui/material').InputBaseProps;
type ReactChangeEventHandler =
import('react').ChangeEventHandler<HTMLInputElement>;
type MuiInputBasePropsBlurEventHandler = Exclude<
MuiInputBaseProps['onBlur'],
undefined
@ -19,7 +16,7 @@ type UncontrolledInputComponentUnmountEventHandler = () => void;
type UncontrolledInputOptionalProps = {
onBlur?: ExtendableEventHandler<MuiInputBasePropsBlurEventHandler>;
onChange?: ExtendableEventHandler<ReactChangeEventHandler>;
onChange?: ExtendableEventHandler<React.ChangeEventHandler<HTMLInputElement>>;
onFocus?: ExtendableEventHandler<MuiInputBasePropsFocusEventHandler>;
onMount?: UncontrolledInputComponentMountEventHandler;
onUnmount?: UncontrolledInputComponentUnmountEventHandler;

Loading…
Cancel
Save