Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Problema com export default

Bom dia,

Estava seguindo o curso sem utilizar o AppRegistry.registerComponent.

chegando na parte 2, precisei utilizar para redirecionar para a pagina de login, mas começou a ocorrer o erro abaixo:

Invariant Violation: Component(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.

This error is located at:
    in Unknown (at registerRootComponent.js:35)
    in RootErrorBoundary (at registerRootComponent.js:34)
    in ExpoRootComponent (at renderApplication.js:33)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:102)
    in RCTView (at View.js:60)
    in View (at AppContainer.js:122)
2 respostas

App.js

import { AppRegistry } from 'react-native';
import Feed from './src/components/Feed';
import Login from './src/screens/Login';

export default () => {
  AppRegistry.registerComponent('InstaluraMobile', () => Login);
}

Login.js

import React from 'react';
import {
    Text
    , View
    , Image
    , Dimensions
    , FlatList
    , StyleSheet
} from 'react-native';

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

export default class Login extends React.Component {

    render() {
        return (
            <View>
                <TextInput placeholder="Usuário..."
                    onChangeText={texto => this.setState({ usuario: texto })} />

                <TextInput placeholder="Senha..."
                    onChangeText={texto => this.setState({ senha: texto })} />
            </View>
        );
    }

}
solução!

Resolvido utilizando o comando "yarn create react-native-app NOME_DO_PROJETO"