简体   繁体   English

反应缩放平移捏抛出未定义的无法读取属性“limitToWrapper”

[英]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“

Image compo图像合成在此处输入图像描述

inside the image compo:在图像组合中: 在此处输入图像描述

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.

相关问题 反应缩放平移捏(setScale) - react-zoom-pan-pinch (setScale) react-zoom-pan-pinch 激活键不起作用 - react-zoom-pan-pinch activation keys not working JavaScript抛出“无法读取未定义的属性……”错误 - JavaScript throws 'cannot read property … of undefined' error 无法读取未定义的属性 - Cannot read property of undefined on react React js性能工具插件抛出“无法读取未定义的属性&#39;计数” - React js Performance tool addon throws “Cannot read property 'counts' of undefined” 带有onClick事件的React函数在控制台中引发“ TypeError:无法读取未定义的属性&#39;handleDelete&#39;” - React function with onClick event throws “TypeError: Cannot read property 'handleDelete' of undefined” in console 仅当我刷新页面时,React 文件抛出错误无法读取未定义的属性“样式” - React file throws error Cannot read property 'style' of undefined only when I refresh the page react-native redux登录表单抛出&#39;TypeError:无法读取未定义的属性&#39;displayName&#39;&#39;&#39; - react-native redux Login Form throws an 'TypeError: Cannot read property 'displayName' of undefined'' 多点触控捏合、平移、放大 HTML 5 画布 - Multitouch Pinch, Pan, Zoom in HTML 5 Canvas D3缩放-无法读取未定义的属性“应用” - D3 zoom - Cannot read property 'apply' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM