Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

App.js funcionando (novo react-native) aula2 ativ2

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * @format
 * @flow
 */

import React, {Fragment} from 'react';
import {
  SafeAreaView,
  StyleSheet,
  ScrollView,
  View,
  Image,
  Dimensions,
  Text,
  StatusBar,
} from 'react-native';

import {
  Header,
  LearnMoreLinks,
  Colors,
  DebugInstructions,
  ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

const width = Dimensions.get('screen').width;

const App = () => {
  const fotos = [
    {id: 1, usuario: 'rafael'},
    {id: 2, usuario: 'alberto'},
    {id: 3, usuario: 'vitor'}
  ];
  return (
    <Fragment>
      <View>
        {fotos.map(foto => 
          <View key={foto.id}>
            <Text>{foto.usuario}</Text>
            <Image source={require('./resources/img/alura.jpg')}
                   style={{width: width, height: width}}
            />
          </View>
         )}
        <Text>Step One</Text>
        <Image source={require('./resources/img/alura.jpg')}
                style={{width: width, height: width}} />
      </View>
    </Fragment>
  );
};

const styles = StyleSheet.create({
  scrollView: {
    backgroundColor: Colors.lighter,
  },
  engine: {
    position: 'absolute',
    right: 0,
  },
  body: {
    backgroundColor: Colors.white,
  },
  sectionContainer: {
    marginTop: 32,
    paddingHorizontal: 24,
  },
  sectionTitle: {
    fontSize: 24,
    fontWeight: '600',
    color: Colors.black,
  },
  sectionDescription: {
    marginTop: 8,
    fontSize: 18,
    fontWeight: '400',
    color: Colors.dark,
  },
  highlight: {
    fontWeight: '700',
  },
  footer: {
    color: Colors.dark,
    fontSize: 12,
    fontWeight: '600',
    padding: 4,
    paddingRight: 12,
    textAlign: 'right',
  },
});

export default App;
1 resposta
solução!

Acima está o código final do App.js da aula 2 atividade 2 com:

react-native-cli: 2.0.1

react-native: 0.60.5

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software