axa-rn-web-view

1.0.6 • Public • Published

AXA React Native Web View

A middleware for react-native-web-view. This package will help you locally embedded Static HTML site for your react native project.

Installation

npm i axa-rn-web-view --save

Usage

Import the AxaWebView component from axa-rn-web-view and use it like so:

import React, { Component } from 'react';
import { Platform, StyleSheet, View, SafeAreaView } from 'react-native';
import AxaWebView from 'axa-rn-web-view';
 
export default class App extends Component {
  onHandleNavigationChange = values => {
    console.log(values);
  };
 
  render() {
    const sourceUri =
      (Platform.OS === 'android' ? 'file:///android_asset/' : '') +
      'Web.bundle/loader.html';
 
    return (
      <View style={styles.container}>
        <SafeAreaView style={styles.container}>
          <AxaWebView
            javaScriptEnabled={true}
            originWhitelist={['*']}
            sourceUri={sourceUri}
            allowFileAccess={true}
            handleNavigationChange={this.onHandleNavigationChange}
          />
        </SafeAreaView>
      </View>
    );
  }
}
 
const styles = StyleSheet.create({
  container: {
    flex: 1
  }
});

For more, read the API Reference and Guide. If you're interested in contributing, check out the Contributing Guide.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Package Sidebar

Install

npm i axa-rn-web-view

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

3.83 kB

Total Files

3

Last publish

Collaborators

  • romeo.enso