RevenueCat / react-native-purchases

React Native in-app purchases and subscriptions made easy. Support for iOS and Android.
https://www.revenuecat.com
MIT License
776 stars 84 forks source link

Fix paywall footer dismissal crash #1120

Closed tonidero closed 3 weeks ago

tonidero commented 3 weeks ago

This fixes https://github.com/RevenueCat/react-native-purchases/issues/994

Basically when the footer is dismissed within the same view, it triggers a new layout, which since we call a remeasurement with a post call, this remeasurement may happen after the view has been removed from the window. This view requires access to the context to be able to obtain the ViewModel in the underlying composable, causing a crash.