gpt4 book ai didi

reactjs - 具有 "GetWrappedInstance"的元素的正确接口(interface)是什么

转载 作者:搜寻专家 更新时间:2023-10-30 20:53:06 24 4
gpt4 key购买 nike

我正在用 typescript 写 React+Redux。我需要访问一个包装实例的引用,例如 this.refs.items.getWrappedInstance() , 但出现 typescript 错误 Property 'getWrappedInstance' does not exist on type 'ReactInstance'
items应该给哪个接口(interface)?是否有我可以声明或需要创建自己的 Redux 定义的接口(interface)?
我尝试使用 google 和搜索 stackoverflow 但找不到答案。

谢谢!

最佳答案

我们在使用 Flow 时遇到了同样的错误,我们最资深的 UI 开发人员最终说要使用//$FlowIgnore: some comment

我认为,因为访问 wrappedInstance 是一种反模式流程, typescript 可能不支持它......现在?

如果有人有不同的答案,我很感兴趣。

关于reactjs - 具有 "GetWrappedInstance"的元素的正确接口(interface)是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49827511/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com