Skip to content

Passing styles to Paywall in react-native-purchases-ui not working #1366

@christophby

Description

@christophby

Describe the bug
When passing styles - in this case paddingTop - via the style prop, the style it not being applied to the paywall.
Only when adding a timeout before rendering the paywall, it seems to work.

This comment let me try the timeout solution.

❌ not working example

export function PaywallScreen() {
  return (
    <View style={{ flex: 1, backgroundColor: "#fff" }}
        <RevenueCatUI.Paywall
          style={{ paddingTop: 32 }}
        />
    </View>
  );
}

✅ working example

export function PaywallScreen() {
 const [loading, setLoading] = React.useState(true);

  return (
    <View style={{ flex: 1, backgroundColor: "#fff" }}>
      {loading ? (
        <View style={{ flex: 1, alignItems: "center", justifyContent: "center" }}>
          <ActivityIndicator />
        </View>
      ) : (
        <RevenueCatUI.Paywall
          style={{ paddingTop: 32 }}
        />
     )}
    </View>
  );
}
  1. Environment
    1. Platform: React Native, iOS simulator
    2. SDK version: "react-native-purchases": "9.2.2", "react-native-purchases-ui": "9.2.2",
    3. OS version: 15.5
    4. Xcode version: 16.3
    5. React Native version: 0.76.9 (no expo)
    6. SDK installation (CocoaPods + version or manual):
    7. How widespread is the issue. Percentage of devices affected.
  2. Debug logs that reproduce the issue
  3. Steps to reproduce, with a description of expected vs. actual behavior
  4. Other information (e.g. stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc.)

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions