Skip to main content
.allowsHitTesting(enabled: boolean): Component;

Parameters

enabled
boolean
Whether the view can receive touch events and user interaction.

Support

Usage

Disable hit testing

Rectangle()
    .fill(Color("blue"))
    .allowsHitTesting(false)

Enable hit testing

Button("Clickable", () => {})
    .allowsHitTesting(true)