gpt4 book ai didi

ios - 代理 : trap returned descriptor for property '0' that is incompatible with the existing property in the proxy target 上的“getOwnPropertyDescriptor”

转载 作者:行者123 更新时间:2023-12-01 22:19:46 24 4
gpt4 key购买 nike

在我的 React Native 应用程序中,我正在尝试使用 wix 的 react-native-navigation 通过 passProps 将 Realm 对象推送到另一个屏幕。 .这是我的代码:

在渲染()

render () {
var entry = this.props.entry // this is a realm object
return (
<Text onPress={() => this.gotoEdit(entry)}>EDIT</Text>
)
}

gotoEdit 函数:
gotoEdit (entry) {
this.props.navigator.push({
screen: 'app.EditEntry',
title: 'EDIT',
passProps: {entry} // when this line is removed, the navigator works fine
})
}

但是,点击“编辑”,应用程序崩溃。我在 React 调试器中收到这条消息:

代理上的“getOwnPropertyDescriptor”:陷阱返回的属性“0”的描述符与代理目标中的现有属性不兼容

最佳答案

我想到了。你不能将 Realm 对象作为 Prop 推送到另一个屏幕而不崩溃。解决方案是传递对象的标识属性,例如ID,然后使用它来引用下一个屏幕中的对象。

关于ios - 代理 : trap returned descriptor for property '0' that is incompatible with the existing property in the proxy target 上的“getOwnPropertyDescriptor”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46046823/

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