-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspa.jsx
More file actions
40 lines (37 loc) · 1.45 KB
/
spa.jsx
File metadata and controls
40 lines (37 loc) · 1.45 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
import React from 'react';
export default function SPA() {
return (
<div className="space-y-6 font-mono text-sm leading-relaxed">
<p>
A{' '}
<strong className="text-current">Single Page Application (SPA)</strong>{' '}
is a web application that interacts with the user by dynamically
rewriting the current web page with new data from the web server,
instead of the default method of a browser loading entire new pages.
</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">
{' '}
{'//'} SPA Navigation
</div>
<div className="text-current">User clicks "Blog"</div>
<div className="text-gray-500 pl-4">
{'->'} URL changes to /blog (via client router)
</div>
<div className="text-gray-500 pl-4">
{'->'} Component updates without reload
</div>
<div className="text-emerald-500 pl-4">
{'->'} Perceived speed: Instant
</div>
</div>
<p>
Fezcodex uses <code className="text-current">react-router-dom</code> to
manage its SPA behavior. Originally using{' '}
<code className="text-current">HashRouter</code>, we transitioned to{' '}
<code className="text-current">BrowserRouter</code> to support cleaner
URLs and better integration with SSG tools.
</p>
</div>
);
}