question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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: hotreloadnotworking

Same but with a class: hotreloadworking

  • 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:closed
  • Created 7 years ago
  • Reactions:10
  • Comments:24 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sospedracommented, Feb 6, 2017

Bump! +1 on v0.40 (Styling RN apps without HMR is a pain in the 💨 )

0reactions
gaearoncommented, Jun 29, 2019

(The only caveat is that for Fast Refresh to work, you’ll need to move your root component to a separate file)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found