Skip to content

How to restore location of page? #83

@livewater009

Description

@livewater009

Hi,

I have saved current location when page will be disappear. Then when user will open book, I want to restore current page (setLocation) of book again.

const [location, setLocation] = useState<Locator | Link>();
<ReadiumView
            ref={ref}
            file={file}
            location={location}
            settings={settings}
            onLocationChange={(locator: Locator) => setLocation(locator)}
            onTableOfContents={(toc: Link[] | null) => {
              if (toc) {
                setToc(toc);
              }
            }}
          />

It looks like that I need to call setLocation() function after readiumview is completed loading. But I can't find any props function to detect page or book is loaded.

Also how can I get current / total page number ?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions