Skip to content

Commit d668099

Browse files
committed
Update App.tsx
1 parent 3c4ed94 commit d668099

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

example/src/App.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { useEffect } from 'react';
22
import { StyleSheet, Text, View, Button } from 'react-native';
33

44
import {
@@ -21,6 +21,19 @@ const App = () => {
2121
{ peerId: string; rootCid: string; private_ref: string } | {}
2222
>({});
2323

24+
useEffect(() => {
25+
if (!__DEV__) {
26+
console.log = () => null;
27+
//console.error = () => null
28+
}
29+
fula
30+
.registerLifecycleListener()
31+
.then(() => console.log('Lifecycle listener registered'))
32+
.catch((error) =>
33+
console.error('Failed to register lifecycle listener', error)
34+
);
35+
}, []);
36+
2437
let RNFS = require('react-native-fs');
2538
const readFile = () => {
2639
RNFS.readDir(RNFS.DocumentDirectoryPath)

0 commit comments

Comments
 (0)