[英]React zoom pan pinch throws a Cannot read property 'limitToWrapper' of undefined
i have component that renders a image component with zoom equals to true as a props, inside the Image compo i have react zoom pin panch plugin i wrapp the image with the TransformWrapper compo as said in the documentation and throw a error "Cannot read property 'limitToWrapper' of undefined "我有一个组件,它渲染一个缩放等于 true 的图像组件作为道具,在图像组合中我有反应缩放 pin panch 插件我用 TransformWrapper 组合包装图像,如文档中所述并抛出错误“无法读取属性”未定义的limitToWrapper“
I suspect you are not passing the required options
object along to the <TransformWrapper />
component, that contains the limitToWrapper
helper.我怀疑您没有将所需的
options
object 传递给包含limitToWrapper
帮助器的<TransformWrapper />
组件。
See the example in the repo :请参阅repo 中的示例:
<TransformWrapper
options={{
limitToBounds,
transformEnabled,
disabled,
limitToWrapper,
}},
...
>
<img ... />
</TransformWrapper>
You can also check this issue if you are on a version lower than 1.6.1.如果您的版本低于 1.6.1,您也可以检查此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.