Skip to content

Commit 4f654ea

Browse files
committed
Disable native view recycling on iOS to ensure the PDF is reloaded on each render
1 parent 737e6ed commit 4f654ea

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ios/ReactNativePdfRendererLibrary/RNPdfRendererComponentView.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ -(instancetype)init
5858
return self;
5959
}
6060

61+
+(BOOL)shouldBeRecycled
62+
{
63+
// We are disabling recycling for this native view to prevent it from being cached.
64+
// This ensures that the PDF is reloaded every time the component is re-mounted
65+
// or any of its props change, providing a fresh instance for each render.
66+
return NO;
67+
}
68+
6169
- (void)dealloc
6270
{
6371
if (observerAdded) {

0 commit comments

Comments
 (0)