5-stones / react-native-readium

📚 📖 React Native ebook reader for iOS, Android, & Web via Readium
MIT License
83 stars 25 forks source link

fix: fix ref cannot be passed to functional components #33

Closed adesege closed 1 month ago

adesege commented 1 year ago

ReadiumView component is not wrapped with forwardRef which causes React to error out that ref cannot be passed to functional components.

This PR fixes that.

jspizziri commented 1 year ago

@adesege thanks for the PR. Can you please specify the issue you're having that is motivating the PR? As you can see here, a ref can be passed to ReadiumView without issue.

adesege commented 1 year ago

@adesege thanks for the PR. Can you please specify the issue you're having that is motivating the PR? As you can see here, a ref can be passed to ReadiumView without issue.

It works on web because the ReadiumView.web.tsx uses forwardRef. However, on Android, it returns an error because ReadiumView.tsx is not wrapped with forwardRef.

Screenshot 2023-06-12 at 2 41 08 PM
jspizziri commented 1 month ago

Going to close this one as there's a newer PR that attempts to address this same issue.