-
Notifications
You must be signed in to change notification settings - Fork 173
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
Non-stop spinner. #30
Comments
Im experiencing the exact same issue after upgrading to react-native 34.1... The spinner works as expected most of the time but then fails to turn off under certain circumstances forcing me to exit the app - this appears to only occur on iOS |
UPDATE: downgrading from react-native 34.1 => .33 solved the issue... it doesnt seem to have anything to do with the |
same issue here @comountainclimber isn't good idea downgrading react-native to fix a component bug |
@sergiocloud I think you would agree its better than having the entire application non functional |
I suspect that the cause is setting Modal |
Hey guys can you post your implementation or steps to reproduce? |
Might be related to facebook/react-native#10471 ? |
I have the same issue. In random cases but quite often the spinner won't disappear even though I set @b8ne Sample code:
Initially,
|
Hey @gsavvid sorry ive been working on my apps backend lately so havent looked at much RN stuff. Just spent a bit of time looking into it and im tending to agree with @damir-sirola that its related to the iOS issue of not updating UI correctly after state change. Ill have a play around tomorrow :) |
I also think it's related to Modal. I've implemented a workaround using ActivityIndicator in a View and the problem seems to have been resolved but I don't think it's such a nice solution. |
+1 |
1 similar comment
+1 |
Any update on this? |
Any updates on this?? Has anyone found any work arounds currently running rn 39.0 with "react-native-loading-spinner-overlay": "0.4.1" and this issue seemingly occurs completely randomly |
I can confirm it is definitely related to facebook/react-native#10471 You will only ever see this issue when attempting to combine Alert component with the busy spinner... |
Same issue here, with |
Here's a temporary fix everyone (just wrap it with a this.setState({ spinner: false });
setTimeout(() => {
Alert.alert('Oops!', err.message);
}, 100); cc @comountainclimber @prithsharma @gillesBzk @mattotodd @gsavvid @b8ne @damir-sirola @norikt @sergiocloud @Arkanine |
finally, I solve this problem as following:`export default class Loading extends Component{
_show() { _hide(){ `it works well ! |
Same for me, |
@niftylettuce thanks :) |
Another workaround, assuming you are having the issue of the spinner not dismissing as desired when an Alert has been used on iOS, is to update the visible property when dismissing the Alert itself. For example:
I add the cancelable: false so that Android users can't dismiss without clicking the OK, though this issue doesn't seem to exist on Android so its likely unnecessary. |
mine works. if anyone needs. basically mine will spin until data is fully loaded. RN 0.43
Dynamic JSON url finish loading, the spinner will stop. hope it helps. |
Any updated on this? |
Is there a particular version this broke on? Or react native version?
…On Jun 1, 2017 11:06 PM, "Nisarg Thakkar" ***@***.***> wrote:
Any updated on this?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAf7hWtZe0IpyN1mENohUV0yjhWL4CPaks5r_5hIgaJpZM4KP0j3>
.
|
I am using I am trying to debug your file and I found that model was not close while visibility is false any idea about it? |
i am using and don't stop spinner, Any updated on this ? |
This issue still exists. note: I am not using an alert, and the Activity Indicator spins forever after the component that rendered it has unmounted. The RN ActivityIndicator does not produce this error, so I think there is a bug in this library. Maybe a race condition? I'm using react-native: |
I built my own modal spinner, and have the same issue. The problem is that the RN |
This solution does not work? @Sonblind @mealbarracin10 @tatva-nisarg |
@niftylettuce I am not using an Alert. I am changing the navigator. |
@niftylettuce The issue is that the react component will sometimes unmount before unmounting the modal component inside of this library. Solution:When implementing, add the loading screen at the root level and control it by a global store vs having multiple loading spinner components inside the children. This ensures that the parent component is always in memory and can unmount the modal component inside the library. I'm using mobX, so I achieve this by calling |
same issue for me |
@derakhshanfar Does |
It does not change anything on my and @mrgcohen |
still a problem with Alerts RN 0.54.4 |
a solution that worked for me, when I make it visible true and then visible false very quickly it falls, so with a setTimeout in the false it is fixed. WORK setTimeout(() => {
NOT WORK |
Just FYI
won't work because setState is async, there's a callback function you can pass into setState:
|
Just re-confirming here: Putting a delay on the Alert solves the issue. In addition, not sure if it's also related to my problem, hiding the Modal causes a setState on unmounted component error. |
Using a delay on the alert does not always solves this issue. Most of the time it will but sometimes it will not and you would use another delay value... You can still use a rather long delay to cover most of the case if not every cases. ex: 300ms |
I've tried using delays or hiding the component if not loading but spinner mantains on in iOs always, using this code: |
i resolved by using set timeout for alert.
|
I'm going to document this solution along with using it in the root in the README of this project shortly. |
while this might be a solution but i'm using redux also since states are being managed by redux, it will be a long wrong around to call maybe, its modal fault. should you try |
Do we really need to wrap all our alerts in a timeout in order for this to work properly? Seems like a bad solution. |
Pull requests to fix bugs are accepted. |
Sometimes spinner not stops even when visible param receive "true".
The text was updated successfully, but these errors were encountered: