Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

157
Visualizações
React Native - Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function

i am learning react native and i was importing a AppLoading to use custom fonts i a got this error:

Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

my app.js

import React, { useState } from 'react';
import * as Font from 'expo-font';
import Home from './screens/Home';
import { AppLoading } from 'expo-app-loading';

const getFonts = () =>
  Font.loadAsync({
    'nunito-regular': require('./assets/Fonts/Nunito-Regular.ttf'),
    'nunito-bold': require('./assets/Fonts/Nunito-Bold.ttf'),
  });

export default function App() {
  const [fontsLoaded, setFontsLoaded] = useState(false);

  if (fontsLoaded) {
    return <Home />;
  } else {
    return <AppLoading startAsync={getFonts} onFinish={() => setFontsLoaded} />;
  }
}

my Home.js

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

export default function Home() {
  return (
    <View style={styles.container}>
      <Text style={styles.titleText}>Home Screen</Text>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    padding: 24,
  },

  titleText: {
    fontFamily: 'nunito-bold',
    fontSize: 18,
  },
});
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

or you might have mixed up default and named imports.

This is the problem.

You import this:

import { AppLoading } from "expo-app-loading";

The docs say to import this:

import AppLoading from 'expo-app-loading';
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda