更新时间:2022-12-20 21:15:34
我传递了错误的对象.{{...this.panHandlers}}
而不是 { ...this.panHandlers}
I was passing the wrong object. {{...this.panHandlers}}
instead of { ...this.panHandlers}
class CustomStack extends React.Component {
panHandlers = {};
userActivity;
constructor(props) {
super(props);
this.userActivity = new UserActivity();
}
componentDidMount() {
this.userActivity.startTimer();
this.panHandlers = this.userActivity.panHandlers();
}
static router = AuthenticatedNavigator.router;
render() {
const {
navigation
} = this.props;
return <AuthenticatedNavigator screenProps = { ...this.panHandlers
}
navigation = {
navigation
}
/>;
}
}