-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When Session Replay SVG tracking is enabled, the babel plugin wraps every react-native-svg component in a <SessionReplayView.Privacy> View with style={{ flexShrink: 1 }}. React Native
defaults flexShrink to 0. This causes SVG icons to shrink below their specified dimensions inside constrained flex containers.
| Replay Enabled | Replay Disabled |
|---|---|
|
|
Reproduction steps
Example - https://github.com/BogiKay/dd-sdk-reactnative/tree/reply-flex-shrink-bug
- Install packages:
yarn add @datadog/mobile-react-native @datadog/mobile-react-native-session-replay @datadog/mobile-react-native-babel-plugin react-native-svg
- Enable SVG tracking in babel.config.js:
module.exports = {
presets: ['module:@react-native/babel-preset'],
plugins: [
['@datadog/mobile-react-native-babel-plugin', {
sessionReplay: { svgTracking: true },
}],
],
};
- Create an SVG icon:
import Svg, { Path } from 'react-native-svg';
const MyIcon () => (
<Svg fill="none" viewBox="0 0 24 24">
<Path fill="black" d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z" />
</Svg>
);
- Render inside a constrained flex row:
<View style={{ flexDirection: 'row', width: 80 }}>
Label
- The icon renders smaller than 24×24. Inspecting the bundle output shows the wrapper has
style={{ flexShrink: 1 }}.
SDK logs
Expected behavior
Layout is unaffected
Affected SDK versions
3.1.1
Latest working SDK version
N/A
Did you confirm if the latest SDK version fixes the bug?
Yes
Integration Methods
Yarn
React Native Version
0.81.5
Package.json Contents
No response
iOS Setup
No response
Android Setup
No response
Device Information
No response
Other relevant information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

