<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<table role="table">
<thead>
<tr>
<th>technologies</th>
</tr>
</thead>
<tbody>
<tr>
<td>react router dom</td>
</tr>
<tr>
<td>material-ui</td>
</tr>
<tr>
<td>hooks and functional components</td>
</tr>
<tr>
<td>context API and providers</td>
</tr>
</tbody>
</table>
<p dir="auto">when i want to navigate between routes , i get this error :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)"><pre class="notranslate"><code class="notranslate">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)
</code></pre></div>
<p dir="auto">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 ) .</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="The above error occurred in the &lt;Transition&gt; 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)"><pre class="notranslate"><code class="notranslate">The above error occurred in the &lt;Transition&gt; 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)
</code></pre></div>
<p dir="auto">when i write the code in sandbox , everything works fine , but in my project , is not .<br>
even i dont know where i have to check for this error , because i have no <code class="notranslate">findDomNode</code> function .</p>
<h5 dir="auto">what i did for this</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> remove all contexts</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> remove material-ui provider</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> remove Suspense and lazy</li>
</ul>
<p dir="auto">but nothing change</p>
<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong></p>
<p dir="auto">Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong></p>
<p dir="auto">I have a component which listens for resize events (via a BlueprintJS ResizeSensor). When loading a component dynamically with <code class="notranslate">lazy</code> / <code class="notranslate">Suspense</code>, an exception occurs as the resize sensor appears to be unmounted:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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)"><pre class="notranslate"><code class="notranslate">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)
</code></pre></div>
<p dir="auto">The resize sensor <a href="https://github.com/palantir/blueprint/blob/develop/packages/core/src/components/resize-sensor/resizeSensor.tsx#L73">should be removing listeners on unmount</a>.</p>
<p dir="auto">Demo: <a href="https://codesandbox.io/s/n4241q075l" rel="nofollow">https://codesandbox.io/s/n4241q075l</a><br>
Related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="379428100" data-permission-text="Title is private" data-url="https://github.com/palantir/blueprint/issues/3141" data-hovercard-type="issue" data-hovercard-url="/palantir/blueprint/issues/3141/hovercard" href="https://github.com/palantir/blueprint/issues/3141">palantir/blueprint#3141</a></p>
<p dir="auto"><strong>What is the expected behavior?</strong></p>
<p dir="auto">No exception is thrown.</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong></p>
<p dir="auto">Tested with:</p>
<ul dir="auto">
<li>React 16.6.1, fails</li>
<li>React 16.6.0, works</li>
</ul>