You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/utils/data/concepts.js
+89-5Lines changed: 89 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -283,7 +283,7 @@ app.get('*', (req, res) => {
283
283
\${scriptTags}
284
284
</body>
285
285
</html>
286
-
\`)
286
+
\`);
287
287
});
288
288
...
289
289
@@ -330,8 +330,7 @@ const App = () => (
330
330
<Chats />
331
331
</div>
332
332
);
333
-
334
-
export default App;`,
333
+
...`,
335
334
textDescription:`
336
335
1. Install [@loadable/babel-plugin](https://www.npmjs.com/package/@loadable/babel-plugin) and setup \`.babelrc\` in order to transpile your server-side code.
337
336
\`\`\`
@@ -426,8 +425,7 @@ const App = () => (
426
425
<Chats />
427
426
</div>
428
427
);
429
-
430
-
export default App;`,
428
+
...`,
431
429
textDescription:`
432
430
1. Install [@loadable/babel-plugin](https://www.npmjs.com/package/@loadable/babel-plugin) and setup \`.babelrc\` in order to transpile your server-side code.
433
431
\`\`\`
@@ -455,6 +453,92 @@ textDescription:`
455
453
linesInPrimary: [10,11,12,13,14,16,17,18,19]
456
454
},
457
455
{
456
+
id: 'progressive-hydration',
457
+
optionName: 'Progressive Hydration',
458
+
codeSnippet:
459
+
`// server/index.js
460
+
import express from 'express';
461
+
import React from 'react';
462
+
import ReactDOMServer from 'react-dom/server';
463
+
import App from './App';
464
+
465
+
const app = express();
466
+
467
+
app.get('*', (req, res) => {
468
+
const html = ReactDOMServer.renderToString(<App />);
[Concurrent Mode](https://reactjs.org/docs/concurrent-mode-intro.html) enables Progressive Hydration — making individual React components interactive before all JS loads.
533
+
534
+
#### References:
535
+
* [(twitter) Progressive Hydration by Dan Abramov](https://twitter.com/dan_abramov/status/1200111677833973760?s=19)
0 commit comments