Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import { View, Text } from 'react-native';
- import axios from 'axios';
- import PhotoSection from './photo-section';
- //functional is just returning some data - static
- //smart component for dynamic class component
- export default class PhotoFeed extends Component {
- render() {
- axios.get('http://192.168.1.208:3000/photos')
- .then(response=>console.log(response));
- return (
- <View>
- <Text> hello </Text>
- </View>
- );
- }
- }
- http://localhost:3000/photos // if this works follow below
- axios.get('/photos')
- .then(response=>console.log(response));
- return (
- <View>
- <Text> hello </Text>
- </View>
- );
Add Comment
Please, Sign In to add comment