Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN 0.61 fast refresh doesn't work (windows10/genymotion) #27583

Closed
rahamin1 opened this issue Dec 20, 2019 · 3 comments
Closed

RN 0.61 fast refresh doesn't work (windows10/genymotion) #27583

rahamin1 opened this issue Dec 20, 2019 · 3 comments
Labels
Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@rahamin1
Copy link

rahamin1 commented Dec 20, 2019

Problem description

(also posted in https://stackoverflow.com/questions/59424152/fast-refresh-that-was-introduced-in-react-native-0-61-doesnt-work?noredirect=1#comment105035061_59424152)

I am running a very basic 'app' (a single file, a single component) for which the code is attached below, using React native 0.61.

Developing for android, on windows 10 with genymotion.
Fast Refresh is turned on, but it doesn't seem to work, See details under Steps To Reproduce below.

react-native info:

System:
OS: Windows 10 10.0.18362
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 5.08 GB / 15.87 GB
Binaries:
Node: 10.16.3 - C:\Program Files\nodejs\node.EXE
Yarn: 1.19.1 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
SDKs:
Android SDK:
API Levels: 23, 24, 25, 26, 27, 28, 29
Build Tools: 25.0.2, 28.0.3, 29.0.2
System Images: android-25 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
IDEs:
Android Studio: Version 2.3.0.0 AI-162.3764568
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5

Steps To Reproduce

  • Run the code that is attached at the bottom of this message.
  • Fast Refresh is turned on, but it doesn't seem to work, for example, when:
  1. I am changing the 'Posts' string to 'New Posts'
  2. When I remove the posts button

Only the debug menu's "reload" refreshes the app and renders the changes.

Describe what you expected to happen:

I expected the emulator to refresh on any of the above changes.

The code:

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

export const App = () => {

  const [resource, setResource] = useState('todos');

  return (
    <View style={{ flex: 1, alignItems: 'center', marginTop: 30 }}>
      <View style={{ flexDirection: 'row', marginTop: 0,
        alignItems: 'center', justifyContent: 'center' }}>
        <TouchableOpacity onPress={() => (setResource('posts'))}>
          <View style={styles.button}>
            <Text style={styles.buttonText}>
              Posts
            </Text>
          </View>
        </TouchableOpacity>
        <View style={{ width: 20 }} />
        <TouchableOpacity onPress={() => setResource('todos')}>
          <View style={styles.button}>
            <Text style={styles.buttonText}>
              Todos
            </Text>
          </View>
        </TouchableOpacity>
      </View>
    </View>
  );
}

const styles = StyleSheet.create({
  buttonText: {
    color: 'black',
    fontSize: 20
  },
  button: {
    backgroundColor: '#a8a',
    justifyContent: 'center',
    alignItems: 'center',
    paddingVertical: 5,
    paddingHorizontal: 10,
    borderRadius: 2
  }
});
@rahamin1 rahamin1 added the Bug label Dec 20, 2019
@react-native-bot
Copy link
Collaborator

Thanks for submitting your issue. Can you take another look at your description and make sure the issue template has been filled in its entirety?

👉 Click here if you want to take another look at the Bug Report issue template.

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Resolution: Needs More Information labels Dec 20, 2019
@rahamin1
Copy link
Author

Done

@rahamin1
Copy link
Author

Update: a day passed and I started my app again. Didn't change anything since posting the question. Now it works fine. No idea what happened... From the fact that two people marked this question as useful, I understand that I am not the only one having this problem...

@facebook facebook locked as resolved and limited conversation to collaborators Oct 2, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants