Issue 1:
Do you want to request a feature or report a bug?

Bug

What is the current behavior?

technologies

react router dom

material-ui

hooks and functional components

context API and providers

when i want to navigate between routes , i get this error :

at invariant (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:57:19)
at findCurrentFiberUsingSlowPath (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4395:31)
at findCurrentHostFiber (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:4407:27)
at findHostInstanceWithWarning (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21472:25)
at Object.findDOMNode (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:22024:18)
at ref (webpack-internal:///./node_modules/@material-ui/core/Slide/Slide.js:255:52)
at commitAttachRef (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:18104:11)
at commitAllLifeCycles (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:19480:11)
at HTMLUnknownElement.callCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:147:18)
at Object.invokeGuardedCallbackDev (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:196:20)
at invokeGuardedCallback (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:250:35)
at commitRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:19699:11)
at eval (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21247:9)
at Object.unstable_runWithPriority (webpack-internal:///./node_modules/scheduler/cjs/scheduler.development.js:255:16)
at completeRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21246:17)
at performWorkOnRoot (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21169:13)
at performWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21074:11)
at performSyncWork (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21048:7)
at interactiveUpdates$1 (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:21333:11)
at interactiveUpdates (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:2268:14)
at dispatchInteractiveEvent (webpack-internal:///./node_modules/react-dom/cjs/react-dom.development.js:5086:7)

after this error , i get this error block ( but it is different , because some times i click on Menu component and some times i am in a Drawer ) .

The above error occurred in the <Transition> component:
in Transition (created by Slide)
in EventListener (created by Slide)
in Slide (created by WithTheme(Slide))
in WithTheme(Slide) (created by Drawer)
in div (created by Drawer)
in Drawer (created by WithStyles(Drawer))
in WithStyles(Drawer) (at AppBar/index.js:524)
in div (at AppBar/index.js:457)
in Index (created by WithStyles(Index))
in WithStyles(Index) (at App.js:98)
in BalanceStateProvider (at App.js:96)
in LoginStateProvider (at App.js:95)
in DrawerStateProvider (at App.js:94)
in Suspense (at App.js:93)
in MuiThemeProviderOld (at App.js:92)
in Router (at App.js:91)
in App (at src/index.js:31)
in StateProvider (at src/index.js:30)
in Router (created by BrowserRouter)
in BrowserRouter (at src/index.js:29)

when i write the code in sandbox , everything works fine , but in my project , is not .

even i dont know where i have to check for this error , because i have no findDomNode function .

what i did for this

remove all contexts

remove material-ui provider

remove Suspense and lazy

but nothing change

Issue 2:
Do you want to request a feature or report a bug?

Bug

What is the current behavior?

I have a component which listens for resize events (via a BlueprintJS ResizeSensor). When loading a component dynamically with lazy / Suspense, an exception occurs as the resize sensor appears to be unmounted:

Uncaught Error: Unable to find node on an unmounted component.
at invariant (29.chunk.js:86295)
at findCurrentFiberUsingSlowPath (29.chunk.js:90628)
at findCurrentHostFiber (29.chunk.js:90640)
at findHostInstanceWithWarning (29.chunk.js:106349)
at findDOMNode (29.chunk.js:106869)
at ResizeSensor.componentDidUpdate (29.chunk.js:10535)

The resize sensor should be removing listeners on unmount.

Demo: https://codesandbox.io/s/n4241q075l

Related: palantir/blueprint#3141

What is the expected behavior?

No exception is thrown.

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

Tested with:

React 16.6.1, fails

React 16.6.0, works