Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Commit

Permalink
#154 implementando axios na lista de medicos
Browse files Browse the repository at this point in the history
Signed-off-by: Ezequiel de Oliveira <[email protected]>
Signed-off-by: Guilherme Deusdará <[email protected]>

Co-authored-by: Ezequiel de Oliveira <[email protected]>
Co-authored-by: Guilherme Deusdará <[email protected]>

Signed-off-by: Ezequiel de Oliveira <[email protected]>
  • Loading branch information
EzequielDeOliveira authored and eliseuegewarth committed Apr 17, 2018
1 parent 15f9c33 commit b5e2d3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Screens/ListScreen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import {View, Text, Button, FlatList, ScrollView} from 'react-native';
import UserItem from '../Components/UserItem';
import axios from 'axios';

const styles = {
container: {
Expand Down Expand Up @@ -28,9 +29,8 @@ class ListScreen extends React.Component {
const fetch = require('isomorphic-fetch')
const url = 'https://jsonplaceholder.typicode.com/users'
this.setState({loading: true});
fetch(url)
.then((response) => {return response.json();})
.then((json) => {this.setState({employees: json, loading: false})})
axios.get(url)
.then((response) => {this.setState({employees: response.data, loading: false});})
};

render (){
Expand Down

0 comments on commit b5e2d3d

Please sign in to comment.