How ReaderProvider and useReader work together
masterTo use the framework's features, you must wrap your application (or the component passed to AppRegistry.registerComponent) in the ReaderProvider component.
ReaderProvider provides the context necessary for the useReader hook to function. Without this provider, useReader will not work and you will not be able to access reader manipulation methods.
import * as React from 'react';
import { AppRegistry } from 'react-native';
import { ReaderProvider } from '@epubjs-react-native/core';
import { name as appName } from './app.json';
import App from './src/App';
export default function Main() {
return (
<ReaderProvider>
<App />
</ReaderProvider>
);
}
AppRegistry.registerComponent(appName, () => Main);