import React, { Component } from 'react'; import { Platform, StyleSheet, Text, View, WebView } from 'react-native'; export default class App extends Component { render() { var htmlContent = 'test'; return ( <WebView style={styles.container} javaScriptEnabled={true} domStorageEnabled={true} source={{ html: htmlContent }} /> ); } } const styles = StyleSheet.create({ container: { flex: 1, justifyContent: 'center', alignItems: 'center', backgroundColor: '#e5e5e5', }, });
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter