From 135ee564bb2fdc8da8aabab70a914c4e9259f4b8 Mon Sep 17 00:00:00 2001 From: Gary Miller Date: Mon, 16 May 2022 21:57:59 -0400 Subject: [PATCH] try with dynamic import --- App.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/App.js b/App.js index 151d975..86fe415 100644 --- a/App.js +++ b/App.js @@ -6,7 +6,7 @@ * @flow strict-local */ -import {PrivateKey} from 'bsv-wasm-bundler'; +// import {PrivateKey} from 'bsv-wasm-bundler'; import React from 'react'; import type {Node} from 'react'; import { @@ -57,8 +57,17 @@ const Section = ({children, title}): Node => { const App: () => Node = () => { const isDarkMode = useColorScheme() === 'dark'; - const random = PrivateKey.fromRandom().toHex(); - console.log(random); + // const random = PrivateKey.fromRandom().toHex(); + // console.log(random); + React.useEffect(() => { + const pls = async () => { + const {PrivateKey} = await import('bsv-wasm-bundler'); + const random = PrivateKey.fromRandom().toHex(); + console.log(random); + }; + + pls(); + }, []); const backgroundStyle = { backgroundColor: isDarkMode ? Colors.darker : Colors.lighter,