import React, {Component} from 'react'; import './GroupList.css'; class GroupList extends Component { constructor (props) { super (props); this.state = { groups: [] } } componentDidMount () { fetch('http://localhost:3000/listgroupusers') .then (response => response.json()) .then( response => { //Changing received data to suitable form let group=[ { groupname: response[0].groupname, users: [response[0].username] } ]; let j=0; for (let i=1; i console.log(err)); } //Function that changes received data to list items makeItems = (group, selectGroup) => { return ( ); } render () { const {selectGroup} = this.props; return (

List of Groups with all Users

{this.makeItems(this.state.groups, selectGroup)}
); } } export default GroupList;