How to get current cfi?
Opened this issue · 1 comments
ashokkumar88 commented
Hi,
I want add bookmark for current cfi. How to get the current cfi?
roycechua commented
Hi, to solve this problem, what I did was take location.start.cfi like what I've shown below then I assigned it to a state variable using the useState() hook but you can also use it with this.setState({}) if it's a class-based component.
<Epub
...
onLocationChange={(location) => setCurrentLocation(location.start.cfi)}
/>