Skip to content

Commit ab89f28

Browse files
committedNov 13, 2024·
chore: update nextjs example. #677
1 parent 8b091c3 commit ab89f28

File tree

6 files changed

+26
-2
lines changed

6 files changed

+26
-2
lines changed
 

‎example/nextjs/src/app/layout.tsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ export const metadata: Metadata = {
1212
export default function RootLayout({ children }: { children: React.ReactNode }) {
1313
return (
1414
<html lang="en">
15-
<body className={inter.className}>{children}</body>
15+
<body className={inter.className}>
16+
<header>
17+
<a href="/">Home</a> |<a href="/merge">Merge</a> |<a href="/textarea">TextArea</a>
18+
<br />
19+
</header>
20+
{children}
21+
</body>
1622
</html>
1723
);
1824
}

‎example/nextjs/src/app/merg/page.tsx ‎example/nextjs/src/app/merge/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// import Editor from './_editor';
22
import { MergeExample } from './_editor/Com';
33

4-
export default function Merg() {
4+
export default function Merge() {
55
return (
66
<div>
77
<MergeExample />
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use client';
2+
import { useState } from 'react';
3+
4+
export default function Merg() {
5+
const [value, setValue] = useState('');
6+
return (
7+
<div>
8+
<textarea
9+
className="text-black"
10+
value={value}
11+
onChange={(e) => {
12+
console.log(e.target.value);
13+
setValue(e.target.value);
14+
}}
15+
/>
16+
</div>
17+
);
18+
}

0 commit comments

Comments
 (0)
Please sign in to comment.