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

Hot reloading not working with components as functions #26498

Closed
gbbarroso opened this issue Sep 19, 2019 · 4 comments
Closed

Hot reloading not working with components as functions #26498

gbbarroso opened this issue Sep 19, 2019 · 4 comments
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@gbbarroso
Copy link

I just started a new project and it seems hot reload doesn't work when using components as functions, however it works when changing it to a class that extends React.Component

React Native version: 0.60.5

info Fetching system and libraries information...
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i7-7500U CPU @ 2.70GHz
Memory: 7.19 GB / 15.88 GB
Binaries:
Node: 10.15.3 - C:\Program Files\nodejs\node.EXE
npm: 6.4.1 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5314842

Steps To Reproduce

  1. react-native init myproj
  2. cd ./myproj
  3. react-native run-android
  4. Enable hot reload on app
  5. Change some Text on App.js and save it
  6. Hot reload's tooltip shows up, but no changes are applied
  7. Refactor App function into a class that extends from React.component and move into a render() method.
  8. Hot reloading is now working.

Describe what you expected to happen:
From what I understand it should work for functions components as well, I was reading into react hooks documentations and it even said it would make things easier for hot reloading.

Snack, code example, screenshot, or link to a repository:

@gbbarroso gbbarroso added the Bug label Sep 19, 2019
@ghondar
Copy link

ghondar commented Sep 19, 2019

@gbbarroso in version 0.61-rc3 it already works correctly, but react-native-gesture-handler stops working, in case you are using it

@QutfulloOchilov
Copy link

I have also the same problem

@B27
Copy link
Contributor

B27 commented Sep 22, 2019

@gbbarroso in version 0.61-rc3 it already works correctly, but react-native-gesture-handler stops working, in case you are using it

next release/rc will have fix to react-native-gesture-handler react-native-community/releases#140 (comment)

"A temporary workaround for the problem is to use gestureHandlerRootHOC to wrap top level component of your RN app."

@elicwhite
Copy link
Member

Closing as this is fixed with fast refresh in 0.61 RC

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

No branches or pull requests

6 participants