Skip to content

Commit ed5c61a

Browse files
Merge pull request #219 from remarkablemark/examples/next
chore(examples): add Next.js app
2 parents a9ec5e9 + 7bd4e44 commit ed5c61a

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

examples/next/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.next

examples/next/package.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"scripts": {
3+
"dev": "next dev",
4+
"build": "next build",
5+
"start": "next start"
6+
},
7+
"dependencies": {
8+
"html-react-parser": "../../",
9+
"next": "^10.0.0",
10+
"react": "^17.0.1",
11+
"react-dom": "^17.0.1"
12+
}
13+
}

examples/next/pages/index.js

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import Head from 'next/head';
2+
import parse from 'html-react-parser';
3+
4+
export default function Home() {
5+
return (
6+
<div>
7+
<Head>
8+
<title>Create Next App</title>
9+
</Head>
10+
11+
<main>
12+
<h1 className="title">
13+
{parse(`
14+
Welcome to <a href="https://nextjs.org">Next.js</a>
15+
and HTMLReactParser!
16+
`)}
17+
</h1>
18+
</main>
19+
20+
<style jsx>{`
21+
.title {
22+
font-family: 'Lucida Grande';
23+
}
24+
`}</style>
25+
</div>
26+
);
27+
}

0 commit comments

Comments
 (0)