From 556dadfbc29cc4ec2c1e12ec6970ff0e4469c89d Mon Sep 17 00:00:00 2001 From: Ethan Neff Date: Mon, 12 Oct 2020 21:50:20 -0700 Subject: [PATCH] fix: add blank setNativeProps function on mocked View Prevents a crash on https://github.com/react-navigation/react-navigation/blob/main/packages/stack/src/views/Stack/Card.tsx#L238 Passing an empty function since this I only use `react-native-highlight-updates` for debugging anyways. --- index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 818b2e7..ac74ff8 100644 --- a/index.js +++ b/index.js @@ -8,6 +8,7 @@ const OriginalTouchableOpacity = ReactNative.TouchableOpacity; function getMockContainer(OriginalComponent) { return class extends React.Component { static displayName = 'View'; + setNativeProps() {} render() { return {this.props.children}; } @@ -83,4 +84,4 @@ class HighlightComponent extends React.Component { const colorLayerStyle = {borderWidth: 3, borderColor: this.getColor(), position: 'absolute', top: 0, bottom: 0, left: 0, right: 0}; return ; } -} \ No newline at end of file +}