-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest2.txt
55 lines (37 loc) · 1.12 KB
/
test2.txt
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
import {Component} from 'react';
import Footer from '../components/Footer';
import Logo from '../components/logo';
import Navigation from '../components/Navigation';
class Logement extends Component {
constructor(props) {
super(props);
this.state = {
logementData:{},
};
}
componentDidMount() {
const { id } = this.props.match.params
fetch(`http://localhost:3000//annonces.json?id=${id}`)
.then(res => res.json())
.then((result) => {
this.setState({
logementData : this.props.match.params});
},
)
}
render(){
console.log("Test ", this.props)
console.log("111", this.props.match.params)
console.log('this state', )
const { id } = this.props.match.params
return(
<div className="home">
<Logo />
<Navigation />
<div><h1>test: {id} </h1></div>
<Footer />
</div>
)
}
}
export default Logement;