@mattstuddert
Posted
Great work on this Jasmine! How long have you been working with React for? The app looks great and functions well! 🙂
One small tip I'd suggest is that you could make use of object destructuring within your code to help remove repetition of this.props
. Your CountryDetail.js
file is an example of where this could cut down your code.
Before using props within the render
method you can destructure the properties off of the props
object like this:
render() {
const { location: { borders, name, flag, population, etc etc } } = this.props;
}
The instead of writing <h1>{this.props.location.name}</h1>
you would instead write <h1>{name}</h1>
. Here's an MDN article for more info.
Keep up the great work!