question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support React Native

See original GitHub issue

in RN environment, there’s no global WebAssembly. Can we have a polyfill for it? https://www.npmjs.com/package/webassembly looks promising.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:44 (19 by maintainers)

github_iconTop GitHub Comments

5reactions
jacogrcommented, Jul 20, 2019

Closing this based on https://github.com/polkadot-js/wasm/issues/19#issuecomment-513449451

  • @polkadot/wasm-crypto 0.13.1 has an asm.js fallback (RN-only)
  • @polkadot/util-crypto 0.94.1 uses the above package
  • There (seems to be) a working sr25519 sample of @polkadot/keyring 0.94.1 (uses the above internally) at https://github.com/jacogr/rn-wasm-crypto

If anything else does pop up -

  • make a PR with fixes to the relevant repos
  • log an issue for somebody to take a look at
2reactions
jacogrcommented, Jul 19, 2019
  • Updated XCode
  • Installed cocoapods
  • using 0.13.0-beta.4
  • running NODE_OPTIONS=--max_old_space_size=8192 npm start for the bundler
  • npm run ios for the emulator
  • made the following code changes to https://github.com/qalqi/AwesomeProject -
import { bip39Generate, waitReady } from '@polkadot/wasm-crypto';

const App = () => {
  const [phrase, setPhrase] = useState();

  useEffect(() => {
   // crypto needs to be ready
    waitReady()
      .then(() => {
       // follow index.d.ts - pass in the number of words
        setPhrase(bip39Generate(12));
      })
      .catch((error) => setPhrase(`error: ${error.message}`));;
  }, []);

  return (
    <Fragment>
      <StatusBar barStyle="dark-content" />
      <SafeAreaView>
        <ScrollView
          contentInsetAdjustmentBehavior="automatic"
          style={styles.scrollView}>
          <Header />

          <View style={styles.body}>
            <View style={styles.sectionContainer}>
              <Text style={styles.sectionTitle}>phrase</Text>
              <Text style={styles.sectionDescription}>
                {phrase || '--none--'}
              </Text>
...

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where to get help - React Native
Where to get help. If you need help with your React Native app, the right place to go depends on the type of...
Read more >
Where To Get Support - React
Where To Get Support. React has a community of millions of developers. On this page we've listed some React-related communities that you can...
Read more >
React Native Support - Flipper
React Native Support ... Meta's React Native and Developer Tooling teams work in close collaboration to ensure Flipper offers top-notch out-of-the-box value for ......
Read more >
React Native Paper
React Native Paper library officially supports the new Material Design generation called Material You - a brand new and the most expressive design...
Read more >
React Native for Windows + macOS
React Native for Windows + macOS brings React Native support for the Windows SDK as well as the macOS 10.14 SDK. With this,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found