ReactorUI
  • What's ReactorUI for Xamarin
  • Guide
    • Setting up
    • Hello World Sample
    • Components
      • Component Lifecycle
      • Component Properties
      • Component with children
      • Navigation
      • Component Context
      • Reference to native controls
      • Animation
  • Native Tree and Visual Tree
    • Custom visual nodes
    • Custom Pages
  • Migrating from MVVM model
  • Integrating DI Containers
  • Hot reload troubleshooting
  • Styling and theming
  • Sample with SkiaSharp
Powered by GitBook
On this page

Was this helpful?

Hot reload troubleshooting

PreviousIntegrating DI ContainersNextStyling and theming

Last updated 5 years ago

Was this helpful?

Hot reload in ReactorUI works reloading your Xamarin Forms assembly at run-time. When a component is reloaded, it "lives" in a new assembly that is different from the previous one. Component state is "copied" from the old assembly to the new one.

At given time when you trigger an hot reload operation this things happen: 1. The Xamarin Forms project where the component is defined is built 2. New assembly is transferred to device or emulator through a adb connection 3. ReactorUI hot reload module (XamarinReactorUI.HotReload) load the new assembly in memory 4. The new component version is loaded (that it's actually a different .NET type from the component is currently running) 5. Eventually component state is migrated in a state living in the new assembly copy over all properties from old to new state object. 6. New component is finally attached to visual tree replacing the old one

Best Practices

  1. Component state class should contains only public properties whose types are value-type or string.

  2. If you need a component state with properties other than value-type/string (i.e. classes), host them in a separate assembly (project) that it's not hot reloaded.

NOTE: Hot reload works only in Debug mode

How hot reload works
Separate components assembly from the rest