Skip to content

Commit 2afc658

Browse files
committed
Updated the example of with-draft-js to utilize the App Router.
1 parent ec46f90 commit 2afc658

File tree

4 files changed

+63
-3
lines changed

4 files changed

+63
-3
lines changed

examples/with-draft-js/app/layout.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { Metadata } from "next";
2+
import React from "react";
3+
4+
export const metadata: Metadata = {
5+
title: "Create Next App",
6+
description: "Generated by create next app",
7+
};
8+
9+
export default function RootLayout({
10+
children,
11+
}: Readonly<{
12+
children: React.ReactNode;
13+
}>) {
14+
return (
15+
<html lang="en">
16+
<body>{children}</body>
17+
</html>
18+
);
19+
}

examples/with-draft-js/pages/index.js renamed to examples/with-draft-js/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { Component } from "react";
24
import {
35
Editor,

examples/with-draft-js/package.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
"start": "next start"
77
},
88
"dependencies": {
9-
"draft-js": "^0.11.5",
9+
"draft-js": "^0.11.7",
1010
"next": "latest",
11-
"react": "^18.2.0",
12-
"react-dom": "^18.2.0"
11+
"react": "^18.3.1",
12+
"react-dom": "^18.3.1"
13+
},
14+
"devDependencies": {
15+
"@types/react": "^18.3.5",
16+
"typescript": "^5.6.2"
1317
}
1418
}

examples/with-draft-js/tsconfig.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"compilerOptions": {
3+
"lib": [
4+
"dom",
5+
"dom.iterable",
6+
"esnext"
7+
],
8+
"allowJs": true,
9+
"skipLibCheck": true,
10+
"strict": false,
11+
"noEmit": true,
12+
"incremental": true,
13+
"module": "esnext",
14+
"esModuleInterop": true,
15+
"moduleResolution": "node",
16+
"resolveJsonModule": true,
17+
"isolatedModules": true,
18+
"jsx": "preserve",
19+
"plugins": [
20+
{
21+
"name": "next"
22+
}
23+
],
24+
"strictNullChecks": true
25+
},
26+
"include": [
27+
"next-env.d.ts",
28+
".next/types/**/*.ts",
29+
"**/*.ts",
30+
"**/*.tsx"
31+
],
32+
"exclude": [
33+
"node_modules"
34+
]
35+
}

0 commit comments

Comments
 (0)