Skip to content

Commit 75a2a99

Browse files
Merge pull request #57 from marllonfrizzo/feat/disable-recycling-views
Disable native view recycling on iOS
2 parents 737e6ed + 4f654ea commit 75a2a99

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)