Destructuring from props is not working inside an async function while it's working fine if I use it using this.props.
这是为一个已经在生产中的react-native 应用程序编写的,该应用程序突然开始在两天前返回此错误.
但到目前为止还没有成功.
如果我用this.props.getLoginData代替,效果很好
如果我使用以下函数,它是错误的:
yo = async () => { // with async
const { getLoginData } = this.props; // error
};
虽然以下功能可以正常工作:
yo = () => { // without async
const { getLoginData } = this.props;
console.log(getLoginData); // works fine
};
这也很好:
yo = async () => { // with async
console.log(this.props.getLoginData); // works fine
};
我预计这两种情况都会很好.
Please clone and run 100 to reproduce this bug.
请在自述文件中找到运行项目的步骤和环境信息.医学博士.
提示:您将在控制台中找到错误(按⌘⌥(一)