Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug when the phone is turned off in the app with the component #15

Open
magestein opened this issue May 8, 2018 · 10 comments
Open

bug when the phone is turned off in the app with the component #15

magestein opened this issue May 8, 2018 · 10 comments

Comments

@magestein
Copy link

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,

@cesardeazevedo
Copy link
Owner

Hi, thanks for report, have you experience this issue even with a production build? which react-native version are you using?

@magestein
Copy link
Author

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

@cesardeazevedo
Copy link
Owner

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)?

@magestein
Copy link
Author

magestein commented May 8, 2018

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 :(

@magestein
Copy link
Author

magestein commented May 8, 2018

I have noted that redraw() some times work and some times not. Maybe the code that I showed is wrong?

@cesardeazevedo
Copy link
Owner

Interesting, i will take a look at it as soon as i get some time this week

@magestein
Copy link
Author

Thank you! I appreciate that very much!

@cesardeazevedo
Copy link
Owner

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
collapsing

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.

@mahmoudelfeky
Copy link

try it in on real device you will see the problem

@A-ANing
Copy link

A-ANing commented Aug 8, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants