Closed adesege closed 1 year ago
@adesege ahh yes. Links and Locators are not identical. The link needs to be converted into a locator before navigation is called. A primitive way of doing this is:
setLocation({
href: link.href,
type: 'application/xhtml+xml',
})
You can see more detail on this here
Ok, noted. Do you think this should be handled automatically from the native side, in the library's javascript side or the example app?
I can put up a PR to fix it
@adesege , not currently, I think this should be handled by the user. I think we just need to update the example app to do something like what I chatted above.
Appreciate you catching and being willing to fix!
Happy to help, @jspizziri. Here's the PR https://github.com/5-stones/react-native-readium/pull/37.
I'll resume working on the PDF #8 support and let you know if I have questions.
Cheers!
Using the example app, I'm unable to navigate to the selected page. The modal closes but it doesn't perform the navigation.
Upon further investigation, I found out that onPress parameter on TableOfContents component returns a Link and not a Locator.
I also attempted to use the returned Link object as the initialLocation but it didn't work too.
Swipe navigation works as expected.