Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatusiak authored Dec 24, 2023
1 parent afa15a5 commit 78850f7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions react-native-tutorials/GUN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ npm install @react-native-async-storage/async-storage #for gun storage

# step3: loading gun (App.js)
```js
import React, {useRef} from 'react';
import React, {useRef, useEffect} from 'react';
import PolyfillCrypto from 'react-native-webview-crypto';
import 'react-native-get-random-values';
import Gun from 'gun/src';
import 'gun/lib/mobile';
import Gun from 'gun';
import 'gun/sea';
import 'gun/lib/radix.js';
import 'gun/lib/radisk.js';
Expand All @@ -37,6 +38,11 @@ export default function App() {
store: asyncStore({AsyncStorage}),
});
}
useEffect(function () {
(async function () {
gun.current.user().login(await Gun.SEA.pair());
})();
}, []);
return (
<>
<PolyfillCrypto />
Expand Down

0 comments on commit 78850f7

Please sign in to comment.