Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/fancy/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import Child from './child';
import './bg.css';
import './styles.less';

const DynamicComponent = React.lazy(() => import('./dynamic'));

class App extends React.Component {
state = {
counter: 0
Expand Down Expand Up @@ -45,6 +47,9 @@ class App extends React.Component {
Does it leak SECRET_TOKEN:{' '}
{process.env.SECRET_TOKEN === undefined ? 'No' : 'Yes'}
</p>
<React.Suspense fallback={<div>Loading dynamic component...</div>}>
<DynamicComponent />
</React.Suspense>
<p>Background image snowflake:</p>
<div className="snowflake" style={{ height: 300, width: 300 }} />
<p>Real image snowflake:</p>
Expand All @@ -53,6 +58,7 @@ class App extends React.Component {
The library <code>p-finally</code> is not ES5, so this page should
throw an error in older browsers like IE11.
</p>

</div>
);
}
Expand Down
9 changes: 9 additions & 0 deletions examples/fancy/src/dynamic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

function Dynamic() {
return (
<div className="dynamic">I was loaded dynamically</div>
)
}

export default Dynamic;
6 changes: 6 additions & 0 deletions examples/fancy/src/styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,9 @@
body {
color: @light-blue;
}
.dynamic {
background: lightseagreen;
color: #333;
border-radius: 6px;
padding: 6px;
}
Loading