Last active
May 1, 2020 18:25
-
-
Save Manntrix/9b63092f9e96e7925e7896db693a0738 to your computer and use it in GitHub Desktop.
users.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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