diff --git a/ios/ReactNativePdfRendererLibrary/RNPdfRendererModule.m b/ios/ReactNativePdfRendererLibrary/RNPdfRendererModule.m index 3078105..9d0b582 100644 --- a/ios/ReactNativePdfRendererLibrary/RNPdfRendererModule.m +++ b/ios/ReactNativePdfRendererLibrary/RNPdfRendererModule.m @@ -52,9 +52,11 @@ - (void)handlePageChange:(NSNotification*) notification { NSUInteger currentPageNumber = [view.document indexForPage:view.currentPage]; - view.onPageChange(@{ - @"position": [NSNumber numberWithInteger:currentPageNumber], - @"total": [NSNumber numberWithInteger:view.document.pageCount], + dispatch_async(dispatch_get_main_queue(), ^{ + view.onPageChange(@{ + @"position": [NSNumber numberWithInteger:currentPageNumber], + @"total": [NSNumber numberWithInteger:view.document.pageCount], + }); }); } diff --git a/package.json b/package.json index 3c1080b..6374b31 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "react-native-pdf-renderer", "displayName": "React-Native Pdf Renderer", - "version": "1.3.1", + "version": "1.3.2", "description": "⚛ A zoomable, blazing fast, zero dependencies, pure native, typed PDF Renderer for Android and iOS.", "main": "src", "license": "MIT",