-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcsr.jsx
More file actions
45 lines (41 loc) · 1.73 KB
/
csr.jsx
File metadata and controls
45 lines (41 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React from 'react';
export default function CSR() {
return (
<div className="space-y-6 font-mono text-sm leading-relaxed">
<p>
<strong className="text-current">Client-Side Rendering (CSR)</strong> is
a web development technique where the browser downloads a minimal HTML
file and a large JavaScript bundle. The JavaScript then executes and
builds the entire user interface on the fly.
</p>
<div className="bg-black p-4 border border-white/10 font-mono text-xs my-6">
<div className="text-gray-500 font-bold mb-2">
{' '}
{'//'} CSR Initial HTML
</div>
<div className="text-blue-400">{'<html>'}</div>
<div className="text-blue-400 pl-4">{'<body>'}</div>
<div className="text-white pl-8">{'<div id="root"></div>'}</div>
<div className="text-white pl-8">
{'<script src="bundle.js"></script>'}
</div>
<div className="text-blue-400 pl-4">{'</body>'}</div>
<div className="text-blue-400">{'</html>'}</div>
</div>
<p>
Most standard React apps use CSR. While powerful for interactivity, it
has a "blank white screen" problem during the initial load and is often
invisible to search engine crawlers that don't execute JavaScript.
</p>
<div className="border-l-2 border-white/20 pl-4 py-1">
<strong className="text-current uppercase tracking-wider text-xs block mb-1">
Comparison
</strong>
<span className="text-gray-400 text-xs">
Unlike SSG, where the HTML is ready before it reaches the browser, CSR
requires the user's device to do the heavy lifting of rendering.
</span>
</div>
</div>
);
}