-
-
Notifications
You must be signed in to change notification settings - Fork 77
/
create.tsx
45 lines (38 loc) 路 930 Bytes
/
create.tsx
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'
import Link from 'next/link'
import nookies from 'nookies'
const complex =
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) Ap鈥L, like Gecko) Chrome/87.0.4280.88 Safari/537.36'
/* Website, SSR */
export default class Create extends React.Component {
static getInitialProps(ctx) {
nookies.set(ctx, 'one', complex, {})
nookies.set(ctx, 'two', complex, {})
nookies.set(ctx, 'three', "hey! this one's simple :)", {})
return {
server: true,
}
}
render() {
return (
<>
<h1>Create</h1>
{/* Navigation */}
<nav>
<ul>
<li>
<Link href="/">
<a>List cookies</a>
</Link>
</li>
<li>
<Link href="/remove">
<a>Remove cookies</a>
</Link>
</li>
</ul>
</nav>
</>
)
}
}