Nested stateless components do not hot reload
See original GitHub issue- Provide a minimal code snippet / rnplay example that reproduces the bug.
import React, { Component } from 'react';
import {
AppRegistry,
View,
Text
} from 'react-native';
const ThisWillNotHotReload = () => {
return (
<Text>If change this text, it will not hot reload.</Text>
)
}
const BugTest = () => {
return (
<View style={{
flex: 1,
justifyContent: 'center',
alignItems: 'center'
}}>
<ThisWillNotHotReload />
</View>
)
}
AppRegistry.registerComponent('BugTest', () => BugTest);
- Provide screenshots where appropriate
Stateless components:
Same but with a class:
- What’s the version of React Native you’re using?
0.28.0
- Does this occur on iOS, Android or both?
both
- Are you using Mac, Linux or Windows?
Mac
Issue Analytics
- State:
- Created 7 years ago
- Reactions:10
- Comments:24 (3 by maintainers)
Top Results From Across the Web
react native functional components and hot reloading not ...
In the middle of making a react native application and I'm experimenting with functional programming within React Native and for some reason ...
Read more >Hot Reloading in React - Medium
Updates to nested components work because of how Webpack HMR API is designed. If a module does not specify how to handle updates...
Read more >Stateless Components and Hot Module Reloading · Mobx Doc
Hot Module Reloading with Stateless Components · Use function declarations instead of arrow functions · Make sure your top-level component is a stateful...
Read more >How to Hot-Load React Component in 7 days. Part 2(React)
How to use hot reloading in case of React. ... And Proxy will not understand what are you doing, — as result whole...
Read more >Understanding common frustrations with React Hooks
There are several well-documented problems with class-based lifecycle ... Don't call Hooks inside loops, conditions, or nested functions.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Bump! +1 on v0.40 (Styling RN apps without HMR is a pain in the 💨 )
(The only caveat is that for Fast Refresh to work, you’ll need to move your root component to a separate file)