djorg83 / react-bootstrap-sweetalert

A React implementation of SweetAlert
https://djorg83.github.io/react-bootstrap-sweetalert/
MIT License
252 stars 55 forks source link

Can't call setState on a component that is not yet mounted error #55

Closed briangonzalezmia closed 5 years ago

briangonzalezmia commented 5 years ago

I'm getting the following error in the component after upgrading to 5.1.4. Any help is greatly appreciated!! Thank you, B

Warning: Can't call setState on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the SweetAlert component. 
    in SweetAlert (at Comments/​index.js:211)
    in CommentsSection (created by WithStyles(CommentsSection))
    in WithStyles(CommentsSection)
    in List (created by HotExportedList)
    in HotExportedListingBoat (created by PageRenderer)
    in PageRenderer (at json-store.js:93)
    in JSONStore (at root.js:51)
    in RouteHandler (at root.js:73)
    in EnsureResources (at root.js:61)
    in LocationHandler (at root.js:119)
    in LocationProvider (created by Context.Consumer)
    in Context.Consumer (created by Location)
    in Location (at root.js:118)
    in Root (at root.js:126)

__stack_frame_overlay_proxy_console__ | @ | index.js:2177
-- | -- | --
  | r | @ | backend.js:6
  | warningWithoutStack | @ | react.development.js:167
  | warnNoop | @ | react.development.js:197
  | enqueueSetState | @ | react.development.js:267
  | ./node_modules/react/cjs/react.development.js.Component.setState | @ | react.development.js:325
  | SweetAlert | @ | SweetAlert.js:187
  | SweetAlert | @ | VM872:14
  | constructClassInstance | @ | react-dom.development.js:14186
  | updateClassComponent | @ | react-dom.development.js:18393
  | beginWork$1 | @ | react-dom.development.js:20160
  | beginWork$$1 | @ | react-dom.development.js:25713
  | performUnitOfWork | @ | react-dom.development.js:24661
  | workLoopSync | @ | react-dom.development.js:24637
  | performSyncWorkOnRoot | @ | react-dom.development.js:24236
  | (anonymous) | @ | react-dom.development.js:12181
djorg83 commented 5 years ago

I can't reproduce this locally, but I understand the problem and published v5.1.5 with a fix. I will close this issue. Let me know if this requires further attention.

briangonzalezmia commented 5 years ago

Thank you. Confirmed all good now!