Disclaimer: This is not my code. I just took the react-reader (@gerhardsletten) and changed a very small piece of code to make it work with rtl languages.
For the epubs to work correctly, you need to make sure that content.opf has the following line: