diegomura / diegomura/react-pdf
usePDF hook incompatibility on 3.1.12 release
- Dominant language
- TypeScript
- Stars
- 16.8k
- Forks
- 1.3k
- Avg merge
- 5h 6m
- Merged PRs (30d)
- 52
Description
**Describe the bug**
We update patches automatically in our projects, since we expect them to be backwards compatible and not require us to do manual changes.
However, #2247 was released as a patch, even though it requires users of the previous `usePDF` hook manual changes that are not mentioned anywhere.
**To Reproduce**
Previous usage ([based on test in #2247](https://github.com/diegomura/react-pdf/commit/6d408c838b1aa9bea0db63bf36b2a6932a20404c#diff-4033a9d66a0e35c9412aad257efea5075daee35effb90ab6c668510c602bd04c)):
```diff
# const [instance, updateInstance] = usePDF(
- { document: doc }
# );
# useEffect(
- updateInstance,
# [doc]
# );
```
New usage:
```diff
# const [instance, updateInstance] = usePDF(
+
# );
# useEffect(
+ () => updateInstance(doc),
# [doc]
# );
```
**Expected behavior**
Backwards compatibility on a `patch` or release as a `minor` or even `major` version, which mentions required changes for affected users.
**Desktop (please complete the following information):**
- OS: Linux
- Browser firefox, chromium
- React-pdf version v3.1.12
Contributor guide
Assessment
This issue has not been assessed yet.