victorsoares96 / epubjs-react-native

ePub.js Reader for React Native
MIT License
140 stars 48 forks source link

onRendered() doesn't seem to do anything. #292

Closed aly-001 closed 2 weeks ago

aly-001 commented 1 month ago

Summary

I was wondering what exactly onRendered() does?

I'm looking for a prop that tells me when a new chapter's HTML is loaded in the Webview. I thought that's what onRendered() does. What does it do, and is there any other way of knowing when the content in the Webview's iframe changes?

What platform(s) does this occur on?

iOS

What workflow(s) does this occur on?

Expo Workflow

Environment (or package.json)

{ "name": "screens", "version": "1.0.0", "main": "expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web" }, "dependencies": { "@epubjs-react-native/core": "^1.4.5", "@epubjs-react-native/expo-file-system": "^1.1.3", "@epubjs-react-native/file-system": "^1.1.3", "@expo-google-fonts/lora": "^0.2.3", "@expo/vector-icons": "^14.0.2", "@microsoft/fetch-event-source": "^2.0.1", "@react-native-async-storage/async-storage": "^1.23.1", "@react-native-community/hooks": "^3.0.0", "@react-navigation/bottom-tabs": "^6.5.20", "@react-navigation/native": "^6.1.17", "@react-navigation/stack": "^6.3.29", "@types/react": "~18.2.79", "axios": "^1.7.2", "eventsource": "^2.0.2", "expo": "~51.0.14", "expo-av": "~14.0.6", "expo-document-picker": "~12.0.2", "expo-file-system": "~17.0.1", "expo-font": "~12.0.7", "expo-image-manipulator": "^12.0.5", "expo-linear-gradient": "^13.0.2", "expo-sqlite": "~14.0.4", "expo-status-bar": "~1.12.1", "express": "^4.19.2", "openai": "^4.52.0", "openai-api": "^1.3.1", "react": "18.2.0", "react-native": "0.74.2", "react-native-fs": "^2.20.0", "react-native-gesture-handler": "^2.17.1", "react-native-paper": "^5.12.3", "react-native-safe-area-context": "^4.10.5", "react-native-screens": "^3.32.0", "react-native-svg": "^15.3.0", "react-native-webview": "^13.10.3", "react-navigation": "^5.0.0", "typescript": "~5.3.3", "ws": "^8.17.1" }, "devDependencies": { "@babel/core": "^7.20.0" }, "private": true }

Your .epub file

No response

Minimal reproducible example

No response

I confirm that i have

victorsoares96 commented 3 weeks ago

onLocationChange provides the section/chapter belonging to the current location, I believe it can meet what you need

victorsoares96 commented 3 weeks ago

the useReader hook also provides information about the current section the reader is in

aly-001 commented 2 weeks ago

Amazing, thank you.