500px / 500px-android-blur

Android Blurring View
http://developers.500px.com/2015/03/17/a-blurring-view-for-android.html
MIT License
2.69k stars 326 forks source link

Catch the infinite loop when BlurringView is a child of the view that will be blurred #33

Open ndbroadbent opened 7 years ago

ndbroadbent commented 7 years ago

I've been spending some time fixing up the react-native-blur library, which is not great on Android. The docs need some updates, but right now their suggested usage works on iOS, and can cause an infinite loop on Android.

I think it might be a good idea to add a check in BlurringView, to make sure that there are no circular references that would cause an infinite loop (where the BlurringView is trying to to draw itself).

Not just for React Native developers, but for any other Android developers who might do this by accident, and wonder why their app is just freezing before crashing from a stack overflow.

I don't have a ton of experience with Android, but I can try to submit a PR if you think this is a reasonable idea.