react-reader icon indicating copy to clipboard operation
react-reader copied to clipboard

Arrows (and navigation) not working in React.StrictMode

Open agatumm420 opened this issue 2 years ago • 9 comments

I'm using react-reader for my project, but arrows do not allow to get to another page of the book. Epub seems to be working fine, you can get to different places using chapters at the beginning of the book. Does anyone have any idea why that is going on?

agatumm420 avatar May 21 '22 10:05 agatumm420

Ok I checked and the location is actually changing but nothing new is being displayed. Why could that be?

agatumm420 avatar May 21 '22 11:05 agatumm420

@agatumm420 Still not solved? Try with the demo-book (https://react-reader.metabits.no/files/alice.epub) or share a example

gerhardsletten avatar Jun 03 '22 17:06 gerhardsletten

Also have the same problem, using the exact same snippet on the README tutorial.

Lamarcke avatar Jul 10 '22 00:07 Lamarcke

Setting epub location on localStorage and then retrieving it on first render actually works, and the page changes, but the arrow keys don't change the epub page.

Lamarcke avatar Jul 10 '22 00:07 Lamarcke

@Lamarcke Could you please publish an example where this is not working. Just checked https://react-reader.metabits.no/ and arrow works for me.

gerhardsletten avatar Jul 11 '22 09:07 gerhardsletten

I am having the same problem and just created a sample project with the issue: https://github.com/Gremash/react-reader-test

Gremash avatar Jul 11 '22 20:07 Gremash

I built and deployed the app to Firebase and it works in the cloud: https://react-reader-test.web.app/. It just isn't working when running locally using npm start. Interesting enough it also works using serve against the production build i.e., serve -s build

Gremash avatar Jul 11 '22 21:07 Gremash

@Gremash @Lamarcke Did have a look at the sample repo now, and looks like you need to remove <React.StrictMode> in index.js.

Have to look more into this after vacation how to make the component support strict mode..

gerhardsletten avatar Jul 20 '22 21:07 gerhardsletten

Thank you for your time. I hasn't expecting something like this, but i'm glad there's a way to use your library in my project now, thanks.

Lamarcke avatar Jul 21 '22 08:07 Lamarcke

I've submit PR to fix this issue #123

azu avatar Sep 11 '22 00:09 azu

@azu Published in [email protected]

gerhardsletten avatar Sep 12 '22 08:09 gerhardsletten