Is this a bug report?
Yes
Yes
Environment
Latest Expo App: SDK 24
Target Platform: Android 7.0
Steps to Reproduce
- Run Expo Sample https://snack.expo.io/r1HW4J0EG
- Background Expo Sample
- Foreground Expo Sample
This occurs if I always maintain at least one setIdleCallback queued at the time the app is backgrounded.
Expected Behavior
Counter continues to increment
Actual Behavior
Counter stops running
Reproducible Demo
https://snack.expo.io/r1HW4J0EG
export default class App extends Component {
doIdleWork() {
requestIdleCallback(() => {
this.setState({number: this.state ? this.state.number +1 : 0 });
// setup another requestIdleCallback before we're done
this.doIdleWork();
});
}
componentDidMount() {
this.state = { number:1 };
this.doIdleWork();
}
render() {
return (
<View style={styles.container}>
<Text style={styles.paragraph}>
{this.state ? this.state.number : 0 }
</Text>
<Card title="Local Modules">
<AssetExample />
</Card>
</View>
);
}
}
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Latest Expo App: SDK 24
Target Platform: Android 7.0
Steps to Reproduce
This occurs if I always maintain at least one setIdleCallback queued at the time the app is backgrounded.
Expected Behavior
Counter continues to increment
Actual Behavior
Counter stops running
Reproducible Demo
https://snack.expo.io/r1HW4J0EG