epubjs-react-native icon indicating copy to clipboard operation
epubjs-react-native copied to clipboard

How do I make changeFontSize and changeFontFamily methods work?

Open SamuelPremji opened this issue 2 years ago • 5 comments

The issue seem to be with the library but I have no idea what causes the issue and I've been trying to fix it for weeks.

SamuelPremji avatar Feb 28 '23 01:02 SamuelPremji

you need to wrap all component where you using a hook in ReaderProvider

kravchenko-anton avatar Mar 06 '23 14:03 kravchenko-anton

you need to wrap all component where you using a hook in ReaderProvider

Can you give an example? Like isn't this supposed to work:

export default function App() { const { width, height } = useWindowDimensions(); const {changeFontSize} = useReader();

return ( <SafeAreaView> <ReaderProvider> <Reader src="https://s3.amazonaws.com/moby-dick/OPS/package.opf" width={width} height={height} fileSystem={useFileSystem} onPress={() => changeFontSize('66px')} /> </ReaderProvider> </SafeAreaView> ); }

SamuelPremji avatar Mar 07 '23 19:03 SamuelPremji

const App = () => { return ( <ReaderProvider > <ViewEpubScreen /> </ReaderProvider> ) }

const ViewEpubScreen = () => { // You can use useReader() here const {changeFontSize} = useReader();

return ( <Reader /> ) }

i hope it can help you

oaidinh avatar Mar 10 '23 08:03 oaidinh

const App = () => { return ( <ReaderProvider > <ViewEpubScreen /> </ReaderProvider> ) }

const ViewEpubScreen = () => { // You can use useReader() here const {changeFontSize} = useReader();

return ( <Reader /> ) }

i hope it can help you

That's what I did but it does not work.

SamuelPremji avatar Mar 10 '23 18:03 SamuelPremji

This issue is stale because it has been open for 90 days with no activity.

github-actions[bot] avatar Mar 13 '24 01:03 github-actions[bot]