Passing styles to Paywall in react-native-purchases-ui not working
- [x] I have updated Purchases SDK to the latest version
- [x] I have read the Contribution Guidelines
- [x] I have searched the Community
- [x] I have read docs.revenuecat.com
- [x] I have searched for existing Github issues
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>
);
}
- Environment
- Platform: React Native, iOS simulator
- SDK version: "react-native-purchases": "9.2.2", "react-native-purchases-ui": "9.2.2",
- OS version: 15.5
- Xcode version: 16.3
- React Native version: 0.76.9 (no expo)
- SDK installation (CocoaPods + version or manual):
- How widespread is the issue. Percentage of devices affected.
- Debug logs that reproduce the issue
- Steps to reproduce, with a description of expected vs. actual behavior
- 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.
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hey @christophby,
Thank you for reporting this! I've just passed this issue on to the engineering team for review. We will keep you posted.
Reopened issue. It was closed due to a failing automation. Sorry about that.
Reopened issue. It was closed due to a failing automation. Sorry about that.
No worries 😄 I'm happy that you're taking care of that