Hex Core JS
    Preparing search index...

    Type Alias UseInputValueTranslationArgs<T>

    type UseInputValueTranslationArgs<T> = {
        cleanRawValue?: (rawValue: string) => string;
        onBlur?: () => void;
        setValue: (value: T) => void;
        sideEffect?: (value: T) => void;
        toInputValue: (value: T) => string;
        toValue: (inputValue: string) => T;
        value: T;
    }

    Type Parameters

    • T
    Index

    Properties

    cleanRawValue?: (rawValue: string) => string

    A function to clean values from the input before updating both the input value and the base value. Useful to remove unwanted/disallowed characters.

    onBlur?: () => void

    The base onBlur function, will be wrapped by the returned onBlur function.

    setValue: (value: T) => void

    The set state function for the value.

    sideEffect?: (value: T) => void

    The sideEffect function to call when the base value changes due to a change in the input.

    toInputValue: (value: T) => string

    Convert the base value to an input value.

    toValue: (inputValue: string) => T

    Convert the input value to the base value.

    value: T

    The base/underlying value of the field (e.g. from form state).