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

Try to deny a suspended subtree to change the DOM #5

Open
wants to merge 3 commits into
base: master
from
Open
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+6 −3
Diff settings

Always

Just for now

Prev

Try to suspend a subtree forever

  • Loading branch information...
pomber committed Nov 20, 2018
commit dd968db4a2d41b1a607bc4aabfbf6c726ed9a94a
Copy path View file
@@ -5,6 +5,10 @@ const StockChart = React.lazy(() =>
import(/* webpackChunkName: 'StockChart' */ "./StockChart")
);

function AlwaysSuspend() {
throw new Promise(() => {});
}

class App extends React.Component {
state = {
selectedStock: null
@@ -26,9 +30,8 @@ class App extends React.Component {
)}
{/* Preload <StockChart/> */}
<React.Suspense fallback={null}>
<div hidden={true}>
<StockChart stock={stocks[0]} />
</div>
<StockChart stock={stocks[0]} />
<AlwaysSuspend />
</React.Suspense>
</React.Suspense>
);
ProTip! Use n and p to navigate between commits in a pull request.