Epub not updating on props change
vitorverasm opened this issue · 2 comments
vitorverasm commented
Hi everyone,
I'm trying to change the props of the <Epub />
component such as location
and theme
programaticaly after the first render, but it doesn't work. Any thoughts on that?
I'm using:
<Epub
src={epub}
flow="paginated"
location={page}
onReady={(book) => {
console.tron.log('book', book);
}}
themes={ReaderThemes}
theme={customTheme}
/>
And I'm changing the page
and customTheme
variables using setState.
Info
System:
OS: Linux 5.3 Ubuntu 18.04.3 LTS (Bionic Beaver)
CPU: (4) x64 Intel(R) Core(TM) i5-4440 CPU @ 3.10GHz
Memory: 780.68 MB / 7.65 GB
Shell: 5.4.2 - /usr/bin/zsh
Binaries:
Node: 10.18.1 - ~/.nvm/versions/node/v10.18.1/bin/node
Yarn: 1.21.1 - /usr/bin/yarn
npm: 6.13.4 - ~/.nvm/versions/node/v10.18.1/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Intel x86 Atom_64, android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.2 => 0.61.2
"epubjs-rn": "^0.1.5"
vitorverasm commented
I've managed to do this by modifying the shoudComponentUpdate method of Epub.js inside node_modules. Because the component wasn't updating with location and theme props.
vitorverasm commented
I'll try to make a pull request soon, for now I'm closing this.