plane hugo

This commit is contained in:
Nilstrieb 2021-02-13 17:53:47 +01:00
parent ec7929a9ba
commit ea8fe969a4
7 changed files with 190 additions and 131 deletions

View file

@ -1,4 +1,5 @@
import React from 'react';
import ModelImage from './Plane'
import f22 from './img/raptor-1040097_1920.png'
import harrier from './img/av-8b-harrier-1986422_1920.jpg'
@ -16,27 +17,4 @@ class Modern extends React.Component {
}
}
class ModelImage extends React.Component {
constructor(props) {
super(props);
this.state = {
img: '',
name: '',
}
}
static getDerivedStateFromProps(props) {
return {img: props.img, name: props.name};
}
render() {
return (
<div className="model">
<img src={this.state.img} alt={this.state.name}/>
<div>{this.state.name}</div>
</div>
);
}
}
export default Modern;