-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathnamespace.js
More file actions
28 lines (24 loc) · 740 Bytes
/
namespace.js
File metadata and controls
28 lines (24 loc) · 740 Bytes
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
import dynamic from 'next/dynamic';
import Link from 'next/link';
import { useRouter } from 'next/router';
const DynamicComponent = dynamic(() => import('../components/namespace'));
const Dashboard = () => {
const router = useRouter();
return (
<div>
<DynamicComponent />
<div>Current locale: {router.locale}</div>
<div>
<Link href="/namespace" locale="en">
<a>Change language to (en)</a>
</Link>
</div>
<div>
<Link href="/namespace" locale="de">
<a>Change language to (de)</a>
</Link>
</div>
</div>
);
};
export default Dashboard;