You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Mistes974 Currently Pressable doesn't support foreground ripple. I had created a PR for the same. Until it's released, you can use TouchableNativeFeedback with useForeground prop. Below code should work
import React from "react";
import { Pressable, Box, Center, NativeBaseProvider, View } from "native-base";
import { TouchableNativeFeedback } from "react-native";
export const Example = () => {
return (
<TouchableNativeFeedback
onPress={() => {}}
useForeground
background={TouchableNativeFeedback.Ripple('black')}
>
<Box
bg={{
linearGradient: {
colors: ["lightBlue.300", "violet.800"],
start: [0, 0],
end: [1, 0],
},
}}
p={12}
>
This is a Box with Linear Gradient
</Box>
</TouchableNativeFeedback>
);
};
const config = {
dependencies: {
"linear-gradient": require("expo-linear-gradient").LinearGradient,
},
};
export default function App() {
return (
<NativeBaseProvider config={config}>
<Center flex={1}>
<Example />
</Center>
</NativeBaseProvider>
);
}
Describe the bug
Ripple effect didn't work with Box and LinearGradient
To Reproduce
Expected behaviour
Ripple effect like on material ui buttons : https://material-ui.com/components/buttons/
Platform
The text was updated successfully, but these errors were encountered: