rumax / react-native-PDFView

📚 PDF viewer for React Native
MIT License
300 stars 92 forks source link

Support for new architecture #243

Open tarkcelk opened 1 year ago

tarkcelk commented 1 year ago

Describe the bug Pdf package doesn't work when build a project with new architecture enabled, need to update the package to be compatible.

To Reproduce

Steps to reproduce the behavior:

  1. Render PDF with any kind of resource.
  2. See the fabric incompatibility warning

Expected behavior Proper rendering when new architecture is enabled.

Screenshots Screenshot_1679408336

Smartphone (please complete the following information):

rumax commented 1 year ago

Hi @tarkcelk, new new architecture is still experimental, right?

This documentation is still experimental and details are subject to changes as we iterate.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

mrshahzeb7 commented 1 year ago

Now you can use the "New Renderer Interop Layer" The interop layer is shipped with React Native 0.72

Just add a component name like this in react-native.config.js

module.exports = { project:{ android: { unstable_reactLegacyComponentNames: [ "PDFView" ] }, ios: { unstable_reactLegacyComponentNames: [ "PDFView" ] } }, };

"The interop layer is a feature that lets you reuse legacy Native Components in New Architecture apps"

Read More https://github.com/reactwg/react-native-new-architecture/discussions/135

tarkcelk commented 11 months ago

@mrshahzeb7 thanks, i will be looking to that