import React from 'react' import { Container, ListGroup, ListGroupItem } from 'reactstrap'; import PlantRepsostory from '../repository/PlantRepository' export default class SamplePage extends React.Component { constructor(props) { super(props); this.state = { plants: [] } } updatePlants() { PlantRepsostory.getPlants().then(response => { if (response.status === 200) { this.setState({ plants: response.data }); } }).catch(e => { this.setState({ plants: ["No plants found."] }); }) } componentDidMount() { this.updatePlants() } render() { return (

Right Tree

Right Plant Right Place Right Time

Plant List
{this.state.plants.map(function (plant, i) { return {plant.name}; })}
) } }