class Rnn extends Component{
constructor(props){
super(props);
this.state={
x:[]
}
}
componentWillMount(){
var api={
getroverss(){
var url="https://fcctop100.herokuapp.com/api/fccusers/top/recent";
return fetch(url).then((res) => res.json());
}
},
api.getrovers().then((res) =>{
this.setState({ x: res
})
});
}
render(){
var xx=this.state.x;
console.table(xx);
return (
<h1>print data</h1>
);
}}
I have been using this api get data from it. I have managed to ouput the data on console. How do I get(ouput/print) the data on my webpage? (I want to use fetch method only).