react-fast-pdf
Advanced tools
Comparing version 1.0.13 to 1.0.14
@@ -191,5 +191,14 @@ "use strict"; | ||
(0, react_1.useLayoutEffect)(() => { | ||
var _a, _b, _c, _d; | ||
setContainerWidth((_b = (_a = containerRef.current) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : 0); | ||
setContainerHeight((_d = (_c = containerRef.current) === null || _c === void 0 ? void 0 : _c.clientHeight) !== null && _d !== void 0 ? _d : 0); | ||
if (!containerRef.current) { | ||
return undefined; | ||
} | ||
const resizeObserver = new ResizeObserver(() => { | ||
if (!containerRef.current) { | ||
return; | ||
} | ||
setContainerWidth(containerRef.current.clientWidth); | ||
setContainerHeight(containerRef.current.clientHeight); | ||
}); | ||
resizeObserver.observe(containerRef.current); | ||
return () => resizeObserver.disconnect(); | ||
}, []); | ||
@@ -196,0 +205,0 @@ return (react_1.default.createElement("div", { ref: containerRef, style: Object.assign(Object.assign({}, styles_1.pdfPreviewerStyles.container), containerStyle) }, |
{ | ||
"name": "react-fast-pdf", | ||
"version": "1.0.13", | ||
"version": "1.0.14", | ||
"description": "react-fast-pdf", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
68558
1454