crazycodeboy / react-native-easy-toast

A react native module to show toast like android, it works on iOS and Android.
http://www.devio.org/
MIT License
1.11k stars 263 forks source link

Can't call setState #47

Open grobmeier opened 6 years ago

grobmeier commented 6 years ago

with the example from the readme:

this.refs.toast.show('Time was added successfully.');

I get this:

ExceptionsManager.js:71 Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
    in Toast (at ConfirmScene.js:102)
    in RCTView (at View.js:60)
    in View (at ConfirmScene.js:55)
    in ConfirmScene (created by Connect(ConfirmScene))
    in Connect(ConfirmScene) (at SceneView.js:17)

RN is version is 0.55.3

hassanamin994 commented 6 years ago

Did you put the toaster view in the render method ?

` render() { return (

...
     );

}`

t2 commented 6 years ago

@hassanamin994 I do have the Toast in render(). Is that an issue?

cdunkel commented 5 years ago

Any updates on this?

cdunkel commented 5 years ago

I've created a PR to address this issue:

https://github.com/crazycodeboy/react-native-easy-toast/pull/66