genexu / react-native-pie-chart

Simple pie chart module for your React Native app
MIT License
109 stars 47 forks source link

Disappearing chart on screen off. #7

Closed Zalarox closed 7 years ago

Zalarox commented 7 years ago

Hey,

So I'm having a strange issue with the pie chart disappearing if the screen is turned off and turned back on. I could not figure out a way to re-render the chart in such a scenario. What's going on here?

Thanks!

genexu commented 7 years ago

Greeting,

I just testing on some android device, but there have no situation like that, can you give me more detail about this issue (package dependencies, device info...etc.)?

Thanks for your report.

Zalarox commented 7 years ago

Hey,

Using Nougat (7.1.2) on my own device.

Everything renders okay like so: img1

After turning the screen off, and then back on: img2

Reloading the application makes it show up again.

genexu commented 7 years ago

Did you use other device to test? here is my solution to checking what is problem.

Use react native AppState api to control and check app status, you can also use this api to handle this issue, re-render component when screen turn on, in addition, use console log to confirm render function work normally when device screen turn off and on.

By the way, might you give me some console log to help me understand this issue, thanks a lot :)

AppState https://facebook.github.io/react-native/docs/appstate.html

genexu commented 7 years ago

Because of there are no further comment, i decided to close this issue, if have any question or similar problem, plz give me a notice.