Sanitize View Data

Redact elements by ID

The React Native SDK is a light-weight interface into our native Android and iOS SDKs. For more information on Visual Capture & Replay please see the documentation for those platforms:


React Native elements can be redacted by assigning an appropriate testID attribute. The value lr-hide can be used by default, and additional values to redact can be added through configuration.

Configuring redactionTags

If you wish to redact views by tag values other than lr-hide a list of strings can be supplied when initializing the SDK.

LogRocket.init('APP_SLUG', {
  redactionTags: ['private'],

Using testID to redact views

Apply a testID attribute to any elements you wish to redact from view capture.

<View testID="lr-hide">
  This view will be hidden using the default lr-hide matcher.
<View testID="private">
  This view will be hidden using the custom private matcher.
<View testID="something-else">
  This view will be captured.