Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a way to disable logs #24

Closed
andreirat opened this issue May 18, 2024 · 3 comments · Fixed by #25
Closed

Add a way to disable logs #24

andreirat opened this issue May 18, 2024 · 3 comments · Fixed by #25

Comments

@andreirat
Copy link

Currently, in dev mode, there are some logs for each render of the component.

RENDER <Userpic> Username

A prop or something to disable logs in dev mode would help. It's helpful sometimes, but most of the times, because of the large number of avatars in a screen, is hard to debug other things using the console.

@matsossah
Copy link

Same here, is there a way to disable the log in Userpic.tsx?

// debug('RENDER ', name || email || imageSource);

@Zarinia
Copy link

Zarinia commented Jun 13, 2024

Same here, is there a way to disable the debug log in Userpic.tsx?

// debug('RENDER ', name || email || imageSource);

You can create patch file with this command
npx patch-package react-native-userpic
Result:

diff --git a/node_modules/react-native-userpic/src/Badge.tsx b/node_modules/react-native-userpic/src/Badge.tsx
index b5332d7..a3590c7 100644
--- a/node_modules/react-native-userpic/src/Badge.tsx
+++ b/node_modules/react-native-userpic/src/Badge.tsx
@@ -122,7 +122,7 @@ const Badge = ({
     });
   }
 
-  debug('RENDER <Badge>', value);
+  // debug('RENDER <Badge>', value);
 
   return (
     <Animated.View {...props} style={[rootStyles, style]}>
diff --git a/node_modules/react-native-userpic/src/Userpic.tsx b/node_modules/react-native-userpic/src/Userpic.tsx
index 15390cc..690e7f1 100644
--- a/node_modules/react-native-userpic/src/Userpic.tsx
+++ b/node_modules/react-native-userpic/src/Userpic.tsx
@@ -64,7 +64,7 @@ const Userpic = ({
     setImageSource(defaultSource);
   }, [defaultSource]);
 
-  debug('RENDER <Userpic>', name || email || imageSource);
+  // debug('RENDER <Userpic>', name || email || imageSource);
 
   return (
     <View {...props} style={[styles.root, { width: size, height: size }]}>

@kolking
Copy link
Owner

kolking commented Aug 4, 2024

Please upgrade to v2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants