-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPosts.jsx
More file actions
68 lines (62 loc) · 1.32 KB
/
Copy pathPosts.jsx
File metadata and controls
68 lines (62 loc) · 1.32 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import React from 'react';
import { useParams } from "react-router-dom";
import {
Outlet,
Link
} from "react-router-dom";
const posts = [
{
id: 1,
title: 'New Post From Ani'
},
{
id: 2,
title: 'New Post From Sahil'
},
{
id: 3,
title: 'New Post From Srinath'
}
]
export function PostList() {
// let params = useParams();
return (
<div>
<h4>Posts Under Admin List</h4>
{
posts.map((item, i)=>(
<><Link to={`/admin/posts/${item.id}`}>{item.title}</Link><br/></>
))}
<Outlet />
</div>
)
}
export function UserPosts(){
let params = useParams();
return (
<div>
<strong>Request For Post No. : {params.id}</strong>
</div>
)
}
// export default class UserPosts extends Component {
// constructor(props){
// super(props);
// this.state={
// id: 0
// }
// this.test = this.test.bind(this);
// }
// test(){
// console.log(ids());
// }
// render() {
// this.test();
// return (
// <div>
// <h4>Posts Under Admin List</h4>
// <h5>Post Id : </h5>
// </div>
// )
// }
// }