Skip to content

displayName cannot find #8394

@MJahanzaibKhan

Description

@MJahanzaibKhan

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js b/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js
index 5dacc2c..49409c2 100644
--- a/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js
+++ b/node_modules/react-native-reanimated/lib/module/createAnimatedComponent/createAnimatedComponent.js
@@ -42,7 +42,7 @@ export function createAnimatedComponent(Component, options) {
       forwardedRef: props.ref
     }} />;
   };
-  animatedComponent.displayName = Component.displayName || Component.name || 'Component';
+  animatedComponent.displayName = Component?.displayName || Component.name || 'Component';
   return animatedComponent;
 }
 //# sourceMappingURL=createAnimatedComponent.js.map
\ No newline at end of file
diff --git a/node_modules/react-native-reanimated/lib/module/css/component/createAnimatedComponent.js b/node_modules/react-native-reanimated/lib/module/css/component/createAnimatedComponent.js
index a160a20..2eebc98 100644
--- a/node_modules/react-native-reanimated/lib/module/css/component/createAnimatedComponent.js
+++ b/node_modules/react-native-reanimated/lib/module/css/component/createAnimatedComponent.js
@@ -26,7 +26,7 @@ export default function createAnimatedComponent(Component) {
       forwardedRef: props.ref
     }} />;
   };
-  animatedComponent.displayName = Component.displayName || Component.name || 'Component';
+  animatedComponent.displayName = Component?.displayName || Component.name || 'Component';
   return animatedComponent;
 }
 //# sourceMappingURL=createAnimatedComponent.js.map
\ No newline at end of file
diff --git a/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx b/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
index 2db3148..08c4043 100644
--- a/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
+++ b/node_modules/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
@@ -92,7 +92,7 @@ export function createAnimatedComponent(
   };
 
   animatedComponent.displayName =
-    Component.displayName || Component.name || 'Component';
+    Component?.displayName || Component.name || 'Component';
 
   return animatedComponent;
 }
diff --git a/node_modules/react-native-reanimated/src/css/component/createAnimatedComponent.tsx b/node_modules/react-native-reanimated/src/css/component/createAnimatedComponent.tsx
index ee3ab05..ccb45cf 100644
--- a/node_modules/react-native-reanimated/src/css/component/createAnimatedComponent.tsx
+++ b/node_modules/react-native-reanimated/src/css/component/createAnimatedComponent.tsx
@@ -65,7 +65,7 @@ export default function createAnimatedComponent<P extends object>(
   };
 
   animatedComponent.displayName =
-    Component.displayName || Component.name || 'Component';
+    Component?.displayName || Component.name || 'Component';
 
   return animatedComponent;
 }

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing infoThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenario

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions