Skip to content

Instantly share code, notes, and snippets.

@tsamaya
Created November 5, 2018 14:33
Show Gist options
  • Save tsamaya/a6d8ec4d25d56e04e9bc2a7db4a0d31f to your computer and use it in GitHub Desktop.
Save tsamaya/a6d8ec4d25d56e04e9bc2a7db4a0d31f to your computer and use it in GitHub Desktop.
// ./src/ResultList.js
import React, { Component } from 'react';
class ResultList extends Component {
render() {
const rate = this.props.response.rate || {};
const results = this.props.response.results || [];
return (
<article className="message">
<div className="message-body">
<ol>
{results.map((result, index) => {
return (
<li key={index}>
{result.annotations.flag} {result.formatted}
<br />
<code>
{result.geometry.lat} {result.geometry.lng}
</code>
</li>
);
})}
</ol>
</div>
</article>
);
}
}
export default ResultList;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment