Open hpsaah opened 4 years ago
This is a bug. I have the same problem.
@hpsaah try to add key={scale}
in your props.
Unbeautiful workaround:
...
const [renderCounter, setRenderCounter] = useState(0);
...
useEffect(() => {
setRenderCounter(renderCounter + 1);
}, [scale]);
...
<PDFReader
key={renderCounter}
scale={scale}
...
/>
...
Thanks @FabianoLothor, changing the key property of the component you force to rerender
Thanks for your help!
Hi i'am trying to use the component in another react component handling the scale at state but when i change it the pdf doesn't re-render
how can i fix it? i'am doing anything wrong or is a bug in the component?
thanks