1.0.0-alpha.9 • Published 6 years ago

react-native-ctrlpanel-core v1.0.0-alpha.9

Weekly downloads
11
License
MIT
Repository
github
Last release
6 years ago

React Native bridge for @ctrlpanel/core

Wraps @ctrlpanel/core in a WebView and bridges the API. This is needed since @ctrlpanel/core depends on WebCrypto which is not supported by React Native.

Installation

npm install --save react-native-ctrlpanel-core

Usage

import React, { Component } from 'react'
import { View } from 'react-native'
import CtrlpanelCore from 'react-native-ctrlpanel-core'

class App extends Component {
  constructor (props) {
    super(props)
    this.core = React.createRef()
  }

  componentDidMount () {
    // The API is now available at:
    this.core.current
  }

  render () {
    return (
      <View>
        <CtrlpanelCore ref={this.core} />

        {/* Render your app here */}
      </View>
    )
  }
}