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

286
Visualizações
React Native: Expo's Fast Refresh feature only works in App.js properly in Expo GO mobile app

I have the following folder structure

my-app/
├─ node_modules/
├─ src/
│ ├─ RepositoryItem.jsx
│ ├─ RepositoryList.jsx
│ ├─ Main.jsx
├─ package.json
├─ README.md
├─ App.js

RepositoryList and RepositoryItem are imported into Main.jsx. Main.jsx imported into App.js

If I modify the code in App.js or Main.js, and save it. The Expo GO app immediately shows the changes.

If I modify RepositoryList.jsx or RepositoryItem.jsx components and save, fast refresh happens, but the changes are not shown. Only if i manually reload the app.

If I modify RepositoryList.jsx component AND Main.jsx. The changes in Main.jsx are shown immediately, bit the changes in RepositoryList.jsx only after a manual reload.

Also if I change RepositoryItem or RepositoryList... "Refreshing... Using Fast Refresh shows" but the changes are not reflected in the app

I tried it with a phone and a tablet, problem is present on both devices.

Is there a way to fix this?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You are using JSX files (RepositoryItem.jsx; RepositoryList.jsx; Main.jsx). Have you tried changing the extension just to JS? (Javascript) I.e: RepositoryItem.js

about 4 years ago · Juan Pablo Isaza Relatório

0

Fast Refresh works in files that are nested in subfolders like RepositoryList.js and RepositoryItem.js.

Why it didn't refresh for me is because in RepositoryList I return a FlatList component, and inside of that the renderItem is the RepositoryItem. Like so:

return (
    <View>
        <FlatList
            data={repositories}
            ItemSeparatorComponent={ItemSeparator}
            renderItem={RepositoryItem}
        />
    </View>
);

Now the question is: Why does Fast Refresh not work if I change RepositoryItem, which is the renderItem attribute of FlatList?

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