Paul Krill
Editor at Large

React Native fixes ‘broken’ reloading

news
Oct 1, 20192 mins

New feature called Fast Refresh addresses a number of bugs that caused users to turn off ‘hot reloading‘

smartphone interface hand touch
Credit: Thinkstock

Facebook’s React Native, a framework for building native iOS and Android apps using the React JavaScript UI framework, gains a new and improved reloading experience, called Fast Refresh, with the React Native 0.61 release.

Fast Refresh unifies the existing “live reloading” (reload on save) and “hot reloading” features. Fast Refresh is based on these principles:

  • Support for modern React including Hooks and function components.
  • Graceful recovery after typos and other mistakes, with a fallback to a full reload when needed.
  • No invasive code transformations, making the feature reliable enough to be on by default.

With Fast Refresh, React local state is preserved in function components and Hooks by default. Class components are remounted without preserving state for reliability. Rendering is automatically retried after saving a file; there is no need to reload the app manually after fixing a runtime or syntax error.

Fast Refresh was developed in response to community complaints about the “hot reloading” feature being “broken,” causing many users to turn it off due to reliability issues. Specifically, hot reloading did not work reliably for function components, often failed to update the screen, and was not resilient to typos and mistakes.

Other capabilities in React 0.61 include:

  • Compatibility with use_frameworks! has been fixed, making it easier to integrate React Native into iOS projects built with dynamic frameworks.
  • A useWindowDimensions hook, which automatically subscribes to dimension updates. It can be used in place of the Dimensions API in most cases.
  • React has been upgrade to version 16.9.

Accessing React Native

Instructions on getting started with React Native can be found on the project website.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author