Skip to content

Commit 5a665b3

Browse files
committed
fix: 🐛 raf from webpack than from script tag
1 parent e4bf36a commit 5a665b3

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

App.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const base64 =
2020
'CjAwMDAwMDAwNzkgMDAwMDAgbiAKMDAwMDAwMDE3MyAwMDAwMCBuIAowMDAwMDAwMzAxIDAw' +
2121
'MDAwIG4gCjAwMDAwMDAzODAgMDAwMDAgbiAKdHJhaWxlcgo8PAogIC9TaXplIDYKICAvUm9v' +
2222
'dCAxIDAgUgo+PgpzdGFydHhyZWYKNDkyCiUlRU9G'
23-
const uri = 'http://gahp.net/wp-content/uploads/2017/09/sample.pdf'
23+
// const uri = 'http://gahp.net/wp-content/uploads/2017/09/sample.pdf'
24+
const uri = 'https://www.dropbox.com/s/r7nfdzj6h2kosnh/bhjbjbj.pdf?dl=0&raw=1'
2425

2526
function App() {
2627
const [error, setError] = React.useState<

react-pdf/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<script src="//cdn.jsdelivr.net/npm/[email protected]/build/pdf.min.js"></script>
77
<script src="//cdn.jsdelivr.net/npm/[email protected]/web/pdf_viewer.min.js"></script>
8-
<script src="https://wzrd.in/standalone/raf@latest"></script>
98
<script
109
crossorigin
1110
src="https://unpkg.com/react@16/umd/react.production.min.js"

react-pdf/webpack.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ module.exports = {
3737
externals: {
3838
react: 'React',
3939
'react-dom': 'ReactDOM',
40-
raf: 'raf',
4140
'pdfjs-dist': 'pdfjsLib',
4241
'pdfjs-dist/lib/web/pdf_link_service': 'pdfjsViewer',
4342
},

src/bundleContainer.ts

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

src/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ function viewerHtml(
8484
}, user-scalable=${withPinchZoom ? 'yes' : 'no'}" />
8585
<script src="https://cdn.jsdelivr.net/npm/[email protected]/build/pdf.min.js"></script>
8686
<script src="https://cdn.jsdelivr.net/npm/[email protected]/web/pdf_viewer.min.js"></script>
87-
<script src="https://wzrd.in/standalone/raf@latest"></script>
8887
<script
8988
crossorigin
9089
src="https://unpkg.com/react@16/umd/react.production.min.js"
@@ -285,7 +284,13 @@ class PdfReader extends React.Component<Props, State> {
285284

286285
init = async () => {
287286
try {
288-
const { source, customStyle, withScroll, withPinchZoom, } = this.props
287+
const {
288+
source,
289+
customStyle,
290+
withScroll,
291+
withPinchZoom,
292+
maximumPinchZoomScale,
293+
} = this.props
289294
const { renderType } = this.state
290295
switch (renderType!) {
291296
case 'URL_TO_BASE64': {
@@ -295,6 +300,7 @@ class PdfReader extends React.Component<Props, State> {
295300
customStyle,
296301
withScroll,
297302
withPinchZoom,
303+
maximumPinchZoomScale,
298304
)
299305
break
300306
}
@@ -305,6 +311,7 @@ class PdfReader extends React.Component<Props, State> {
305311
customStyle,
306312
withScroll,
307313
withPinchZoom,
314+
maximumPinchZoomScale,
308315
)
309316
break
310317
}

0 commit comments

Comments
 (0)