Skip to content

Commit 22084f2

Browse files
committed
back hydration
1 parent c157c97 commit 22084f2

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

dist/bundle.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ function App() {
88
<div>
99
<nav>
1010
<Link to="/">Home</Link>
11+
|
1112
<Link to="/blog/1">Blog 1</Link>
1213
</nav>
1314
<Routes>

src/Blog.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22
import { useParams } from 'react-router-dom';
33

44
function Blog() {
55
const { id } = useParams();
6-
return <h1>Blog Page with ID: {id}</h1>;
6+
const [clicked, setClicked] = useState(false);
7+
8+
return (
9+
<div>
10+
<h1>Blog Page with ID: {id}</h1>
11+
<button onClick={() => setClicked(!clicked)}>
12+
{clicked ? 'Clicked!' : 'Click me'}
13+
</button>
14+
</div>
15+
);
716
}
817

918
export default Blog;

src/Home.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22

33
function Home() {
4-
return <h1>Home Page</h1>;
4+
const [clicked, setClicked] = useState(false);
5+
6+
return (
7+
<div>
8+
<h1>Home Page</h1>
9+
<button onClick={() => setClicked(!clicked)}>
10+
{clicked ? 'Clicked!' : 'Click me'}
11+
</button>
12+
</div>
13+
);
514
}
615

716
export default Home;

0 commit comments

Comments
 (0)