Set global default props and handlers
mainUse PressablesConfig to apply default props (like rippleColor) or global event handlers (like haptics) to all pressables within the provider.
defaultProps: Applies standard React Native props to all children.globalHandlers: Allows you to interceptonPress,onPressIn, oronPressOutevents globally. Handlers receive the component'smetadata.skipGlobalHandlers: Use this prop on an individual pressable to opt out of global handlers while still firing its own local handlers.
import { PressablesConfig } from 'pressto';
import * as Haptics from 'expo-haptics';
function App() {
return (
<PressablesConfig
defaultProps={{ rippleColor: 'transparent' }}
globalHandlers={{
onPress: () => {
Haptics.selectionAsync();
},
}}
>
<PressableScale onPress={() => {}} />
{/* Opt out of haptics for this specific button */}
<PressableScale skipGlobalHandlers onPress={() => {}} />
</PressablesConfig>
);
}