Guest User

Untitled

a guest
Feb 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { View, Text } from 'react-native';
  3. import axios from 'axios';
  4. import PhotoSection from './photo-section';
  5. //functional is just returning some data - static
  6. //smart component for dynamic class component
  7. export default class PhotoFeed extends Component {
  8. render() {
  9. axios.get('http://192.168.1.208:3000/photos')
  10. .then(response=>console.log(response));
  11. return (
  12. <View>
  13. <Text> hello </Text>
  14. </View>
  15. );
  16. }
  17. }
  18.  
  19. http://localhost:3000/photos // if this works follow below
  20.  
  21. axios.get('/photos')
  22. .then(response=>console.log(response));
  23. return (
  24. <View>
  25. <Text> hello </Text>
  26. </View>
  27. );
Add Comment
Please, Sign In to add comment