0

The docs mention that the property android_ripple takes an argument of type RippleConfig, but when you click the link for RippleConfig you get a 404.

Doc page: https://reactnative.dev/docs/pressable/#android_ripple-android

Slbox
  • 10,957
  • 15
  • 54
  • 106

2 Answers2

1

Seems like all redirects are broken but below https://reactnative.dev/docs/pressable/#rippleconfig

anthony willis muñoz
  • 2,346
  • 3
  • 16
  • 33
  • 1
    Oh jeez, it's at the bottom of the same page, that's an embarrassing oversight on my part. Thank you! – Slbox Oct 30 '20 at 20:36
0

In your Pressable button pass in a "mode" prop into the Android_ripple config object, for example:

const LogininWithIcon = ({ iconName, onPress, buttonTitle, mode }) => {
  return (
    <View style={styles.buttonContainer}>
 <Pressable
        activeOpacity={Platform.OS === "ios" ? 0.58 : null}
        android_ripple={{
          color:
            mode === "facebook" ? Colors.facebookColor : Colors.googleYellow,
          borderless: false,
        }}
...

Then in the component that will be using the button, pass in the prop like this:

 <LogininWithIcon
            iconName="logo-facebook"
            onPress={() => {}}
            buttonTitle="Facebook"
            color="blue"
            mode="facebook"
          />
etc...
IVIKOS
  • 11
  • 4