import { useState, useRef, useEffect } from 'react' import { ReactReader } from '../../lib/index' import type { Contents, Rendition } from 'epubjs' import { DEMO_URL, DEMO_NAME } from '../components/config' import { Example } from '../components/Example' export const Basic = () => { const [largeText, setLargeText] = useState(false) const rendition = useRef(undefined) const [location, setLocation] = useState(0) useEffect(() => { rendition.current?.themes.fontSize(largeText ? '140%' : '100%') }, [largeText]) return ( } > setLocation(loc)} getRendition={(_rendition: Rendition) => { rendition.current = _rendition rendition.current.themes.fontSize(largeText ? '140%' : '100%') }} /> ) }