Description
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
- react-native init myproj
- cd ./myproj
- react-native run-android
- Enable hot reload on app
- Change some
Text
onApp.js
and save it - Hot reload's tooltip shows up, but no changes are applied
- Refactor
App
function into a class that extends fromReact.component
and move into arender()
method. - 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: