Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

164
Vistas
Flatlist got error message said Nothing was returned from render

how can I solve this problem, I'm facing an error that said

Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.

when I want to show my JSON file in my screen of List (CurrenciesList.js) the code is here

import React from 'react' 
import { FlatList, View } from 'react-native'
import RowItem from '../../components/RowItem'
import currencies from '../../data/currencies.json'

export default () => {
    <View>
        <FlatList 
            data={currencies} 
            renderItem={({item}) => {
                return <RowItem title={item}/>
            }} />
    </View>
}

RowItem is the reusable component and it's passing a text param only.

const RowItem = ({title, onPress}) => {
    return (
        <TouchableOpacity onPress={onPress}>
            <Text style={styles.title}>{title}</Text>
        </TouchableOpacity>
    )
}

export default RowItem

and my file JSON (currencies.json) is like this

[
    "AUD",
    "BGN",
    "BRL",
    "CAD",
    "CHF",
    "CNY",
    "CZK",
    "etc.."
  ]
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Your function does not return anything

change

export default () => {
    <View>

    </View>
}

to:

export default () => {
    return <View>
      ...
    </View>
}

or to

// no curly braces
export default () =>
    <View>
     ...
    </View>
about 4 years ago · Juan Pablo Isaza Denunciar

0

You can try this,

import React from 'react' 
import { FlatList, View } from 'react-native'
import RowItem from '../../components/RowItem'
import currencies from '../../data/currencies.json'

export default () => {
return (
    <View>
        <FlatList 
            data={currencies} 
            renderItem={({item}) => {
                return <RowItem title={item}/>
            }} />
    </View>
);
}
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda