import React from 'react'; import { getChats } from '../api'; import Contact from './Contact.js'; export default class Contacts extends React.Component { constructor(props) { super(props); this.state = { pms: [] }; } componentDidMount() { this.refreshChats(); } refreshChats() { getChats() .then(response => { this.setState({ isLoading: false, pms: response.data.pms }); }); } render() { const { pms } = this.state; return (