react-native-collapsing-toolbar
react-native-collapsing-toolbar copied to clipboard
bug when the phone is turned off in the app with the component
Hello, I found a bug.. When the phone is turned off in the application and then the phone is turned on again then the collapsing component no longer works, is there any way to solve this? I add a video of the problem: https://streamable.com/7e3g8
Regards,
Hi, thanks for report, have you experience this issue even with a production build? which react-native version are you using?
Hi Cesar, thats happen in react-native 0.55.0.. and also happen with '--variant=release'. Is there a suggestion of compatibility with some version of react-native? Thanks
I haven't tried new version from react-native yet, so i presume that new versions "just works".
Have you tried call the redraw()
function from the AppBarLayout ref on componentDidMount or when the app came back from the background (by AppState)?
I have try:
_handleAppStateChange = (nextAppState) => {
if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') {
this.appBar.redraw();
}
this.setState({appState: nextAppState});
};
componentDidMount() {
AppState.addEventListener('change', this._handleAppStateChange);
}
componentWillUnmount() {
AppState.removeEventListener('change', this._handleAppStateChange);
}
<AppBarLayout ref={(ref) => { this.appBar = ref }}>
</AppBarLayout>
but without luck :(
I have noted that redraw() some times work and some times not. Maybe the code that I showed is wrong?
Interesting, i will take a look at it as soon as i get some time this week
Thank you! I appreciate that very much!
Hi, sorry for delayed response, i've fully reproduced your issue on my simulator, and i have tested your code and worked, i tested multiple times and never had any single attempt that didn't worked.
Here's a demonstration
Or maybe i am testing wrong? any idea?
I also don't think this is the best solution at all, it's actually really hard to understand how native modules behave in certain situations, i will still think in some pleasant solution.
try it in on real device you will see the problem
@magestein Hello, how did you solve it? I'm just like you, but I happened when the application was started, not when the application was waked up. #21