RN 封装 WebView ?

简单源码:

import React, { Component } from 'react';
import {
    Platform,
    StyleSheet,
    Text,
    View,
    WebView
} from 'react-native';

export default class TWebView extends Component<Props> {
    constructor(props) {
        super(props);

        this.state = {
            url : this.props.url
        };
    }

    render() {
        return (
            <WebView source={{uri: this.state.url}} style={{marginTop:-20}}/>
        );
    }
}

module.exports = TWebView;