Interface PressProps

Props of the usePress hook.

interface PressProps {
    isDisabled?: boolean;
    onPress?: (() => void);
    onPressChange?: ((isPressed: boolean) => void);
    onPressEnd?: (() => void);
    onPressStart?: (() => void);
}

Hierarchy (view full)

Properties

isDisabled?: boolean

If true then press events are disabled.

false
onPress?: (() => void)

A handler that is called when the press is released over the target.

onPressChange?: ((isPressed: boolean) => void)

A handler that is called when the press state changes.

Type declaration

    • (isPressed): void
    • Parameters

      • isPressed: boolean

        true if an element is pressed.

      Returns void

onPressEnd?: (() => void)

A handler that is called when a press interaction ends, either over the target or when the pointer leaves the target.

onPressStart?: (() => void)

A handler that is called when a press interaction starts.