Skip to content

Instantly share code, notes, and snippets.

@Manntrix
Last active May 1, 2020 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Manntrix/9b63092f9e96e7925e7896db693a0738 to your computer and use it in GitHub Desktop.
Save Manntrix/9b63092f9e96e7925e7896db693a0738 to your computer and use it in GitHub Desktop.
users.js
import React, {Component} from 'react'
import axios from '../../axios'
export default class users extends Component {
constructor(props) {
super(props);
this.state = {
Users: []
};
}
getUsersData() {
axios
.get(`/users`, {})
.then(res => {
const data = res.data
console.log(data)
})
.catch((error) => {
console.log(error)
})
}
componentDidMount(){
this.getUsersData()
}
render() {
return (
<div></div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment