Skip to main content

Overview

Diagnostics are designed for development only. They help you understand what’s happening under the hood when Uniwind Pro updates your styles.
Ever wondered what Uniwind Pro is doing behind the scenes? The Diagnostics API gives you a window into the Shadow Tree. See exactly when components register, unregister, and how styles flow through the C++ engine.

Enabling Diagnostics

Once enabled, you’ll see this confirmation in your console:

What You Can Track

Component Mounts

When reportMounts is enabled, you’ll see every component that registers with the Shadow Tree:

Component Unmounts

When reportUnmounts is enabled, you’ll see components leaving the Shadow Tree:
The count decreases as components are removed. Useful for detecting memory leaks or unexpected unmounts.

Style Updates

This is where it gets interesting. When reportUpdates is enabled, you’ll see exactly what styles are being applied and how:
Updates are grouped into collapsible sections:

Configuration Options

Enable only what you need. Logging everything on a complex screen can get noisy.

Common Use Cases

Debugging Theme Switches

Enable reportUpdates to see all styles that change when switching themes:
Then trigger a theme change and watch the console. You’ll see every component that updates and exactly what properties changed.

Detecting Memory Leaks

All styled views are stored in C++. Enable mount tracking to verify components are properly cleaned up:
Navigate away from a screen and check if all nodes are unregistered. If the count in (5) doesn’t drop to zero when expected, you might have a memory leak.
If you suspect a memory leak in Uniwind Pro, create an issue with the diagnostics output attached.

Verifying Zero Re-renders

Both C++ updates (🔥) and Native updates (✨) are applied without triggering React re-renders. If you see your styles in these logs, Uniwind Pro is working as expected.

Platform Support

Diagnostics only work on native platforms. On web, the enableDiagnostics function is a stub that does nothing.

Shadow Tree Updates

Learn how Uniwind Pro updates styles without re-renders

Theme Transitions

Add smooth animated transitions between themes